Class: Fictive::Syntax::Element
- Inherits:
-
Object
- Object
- Fictive::Syntax::Element
- Defined in:
- lib/fictive/syntax.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(type, text = nil) ⇒ Element
constructor
A new instance of Element.
Constructor Details
#initialize(type, text = nil) ⇒ Element
Returns a new instance of Element.
9 10 11 12 13 |
# File 'lib/fictive/syntax.rb', line 9 def initialize(type, text = nil) @type = type @text = text @children = [] end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
7 8 9 |
# File 'lib/fictive/syntax.rb', line 7 def children @children end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
6 7 8 |
# File 'lib/fictive/syntax.rb', line 6 def text @text end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/fictive/syntax.rb', line 6 def type @type end |
Instance Method Details
#empty? ⇒ Boolean
15 16 17 |
# File 'lib/fictive/syntax.rb', line 15 def empty? @children.empty? end |