Class: Himl::Parser::Document::Tag
- Inherits:
-
Struct
- Object
- Struct
- Himl::Parser::Document::Tag
- Defined in:
- lib/himl/parser.rb
Instance Attribute Summary collapse
-
#block_end ⇒ Object
Returns the value of attribute block_end.
-
#indentation ⇒ Object
Returns the value of attribute indentation.
-
#line ⇒ Object
Returns the value of attribute line.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#block_end ⇒ Object
Returns the value of attribute block_end
8 9 10 |
# File 'lib/himl/parser.rb', line 8 def block_end @block_end end |
#indentation ⇒ Object
Returns the value of attribute indentation
8 9 10 |
# File 'lib/himl/parser.rb', line 8 def indentation @indentation end |
#line ⇒ Object
Returns the value of attribute line
8 9 10 |
# File 'lib/himl/parser.rb', line 8 def line @line end |
#name ⇒ Object
Returns the value of attribute name
8 9 10 |
# File 'lib/himl/parser.rb', line 8 def name @name end |
Instance Method Details
#block_start=(start) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/himl/parser.rb', line 25 def block_start=(start) self.block_end = case start when 'do' 'end' when '{' '}' end end |
#end_tag ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/himl/parser.rb', line 9 def end_tag if has_block? "#{' ' * indentation}<% #{block_end} %>\n" else "#{' ' * indentation}</#{name}>\n" end end |
#has_block? ⇒ Boolean
21 22 23 |
# File 'lib/himl/parser.rb', line 21 def has_block? block_end end |