Method: MaRuKu::MDElement#initialize
- Defined in:
- lib/maruku/structures.rb
#initialize(node_type = :unset, children = [], meta = {}, al = MaRuKu::AttributeList.new) ⇒ MDElement
Returns a new instance of MDElement.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/maruku/structures.rb', line 95 def initialize(node_type=:unset, children=[], ={}, al=MaRuKu::AttributeList.new ) super(); self.children = children self.node_type = node_type @attributes = {} .each do |symbol, value| self.instance_eval " def #{symbol}; @#{symbol}; end def #{symbol}=(val); @#{symbol}=val; end" self.send "#{symbol}=", value end self.al = al || AttributeList.new self. = end |