Class: HamlParser::Ast::Element
- Inherits:
-
Struct
- Object
- Struct
- HamlParser::Ast::Element
- Includes:
- HasChildren
- Defined in:
- lib/haml_parser/ast.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#children ⇒ Object
Returns the value of attribute children.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#lineno ⇒ Object
Returns the value of attribute lineno.
-
#nuke_inner_whitespace ⇒ Object
Returns the value of attribute nuke_inner_whitespace.
-
#nuke_outer_whitespace ⇒ Object
Returns the value of attribute nuke_outer_whitespace.
-
#oneline_child ⇒ Object
Returns the value of attribute oneline_child.
-
#self_closing ⇒ Object
Returns the value of attribute self_closing.
-
#static_class ⇒ Object
Returns the value of attribute static_class.
-
#static_id ⇒ Object
Returns the value of attribute static_id.
-
#tag_name ⇒ Object
Returns the value of attribute tag_name.
Instance Method Summary collapse
-
#initialize ⇒ Element
constructor
A new instance of Element.
- #to_h ⇒ Object
Methods included from HasChildren
Constructor Details
#initialize ⇒ Element
Returns a new instance of Element.
47 48 49 50 51 52 53 54 55 |
# File 'lib/haml_parser/ast.rb', line 47 def initialize(*) super self.static_class ||= '' self.static_id ||= '' self.attributes ||= '' self.self_closing ||= false self.nuke_inner_whitespace ||= false self.nuke_outer_whitespace ||= false end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes
32 33 34 |
# File 'lib/haml_parser/ast.rb', line 32 def attributes @attributes end |
#children ⇒ Object
Returns the value of attribute children
32 33 34 |
# File 'lib/haml_parser/ast.rb', line 32 def children @children end |
#filename ⇒ Object
Returns the value of attribute filename
32 33 34 |
# File 'lib/haml_parser/ast.rb', line 32 def filename @filename end |
#lineno ⇒ Object
Returns the value of attribute lineno
32 33 34 |
# File 'lib/haml_parser/ast.rb', line 32 def lineno @lineno end |
#nuke_inner_whitespace ⇒ Object
Returns the value of attribute nuke_inner_whitespace
32 33 34 |
# File 'lib/haml_parser/ast.rb', line 32 def nuke_inner_whitespace @nuke_inner_whitespace end |
#nuke_outer_whitespace ⇒ Object
Returns the value of attribute nuke_outer_whitespace
32 33 34 |
# File 'lib/haml_parser/ast.rb', line 32 def nuke_outer_whitespace @nuke_outer_whitespace end |
#oneline_child ⇒ Object
Returns the value of attribute oneline_child
32 33 34 |
# File 'lib/haml_parser/ast.rb', line 32 def oneline_child @oneline_child end |
#self_closing ⇒ Object
Returns the value of attribute self_closing
32 33 34 |
# File 'lib/haml_parser/ast.rb', line 32 def self_closing @self_closing end |
#static_class ⇒ Object
Returns the value of attribute static_class
32 33 34 |
# File 'lib/haml_parser/ast.rb', line 32 def static_class @static_class end |
#static_id ⇒ Object
Returns the value of attribute static_id
32 33 34 |
# File 'lib/haml_parser/ast.rb', line 32 def static_id @static_id end |
#tag_name ⇒ Object
Returns the value of attribute tag_name
32 33 34 |
# File 'lib/haml_parser/ast.rb', line 32 def tag_name @tag_name end |
Instance Method Details
#to_h ⇒ Object
57 58 59 60 61 62 |
# File 'lib/haml_parser/ast.rb', line 57 def to_h super.merge( type: 'element', oneline_child: oneline_child && oneline_child.to_h, ) end |