Class: Tumblargh::Node::BlockStart
- Defined in:
- lib/tumblargh/node/block_start.rb
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#matching_end ⇒ Object
24 25 26 |
# File 'lib/tumblargh/node/block_start.rb', line 24 def matching_end "{/block:#{name}}" end |
#name ⇒ Object
5 6 7 8 |
# File 'lib/tumblargh/node/block_start.rb', line 5 def name str = elements[1].text_value "#{str[0].upcase}#{str[1..str.size]}" end |
#options ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/tumblargh/node/block_start.rb', line 10 def arguments = elements[3] return {} if arguments.nil? || arguments.elements.nil? arguments.elements.inject({}) do |memo, node| nodes = node.elements.first.elements k = nodes[0].text_value v = nodes[3].text_value memo[k] = v memo end end |
#to_tree ⇒ Object
28 29 30 |
# File 'lib/tumblargh/node/block_start.rb', line 28 def to_tree return [type, name, ] end |