Class: ARST::Node::Base
- Inherits:
-
Object
- Object
- ARST::Node::Base
- Defined in:
- lib/arst/node/base.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #ancestors ⇒ Object
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
- #type ⇒ Object
Constructor Details
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
8 9 10 |
# File 'lib/arst/node/base.rb', line 8 def children @children end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
8 9 10 |
# File 'lib/arst/node/base.rb', line 8 def parent @parent end |
Instance Method Details
#ancestors ⇒ Object
18 19 20 21 22 |
# File 'lib/arst/node/base.rb', line 18 def ancestors return [] if parent.nil? ( parent.ancestors || [] ) + [self] end |
#type ⇒ Object
24 25 26 |
# File 'lib/arst/node/base.rb', line 24 def type @type ||= ARST::Helpers.underscore(self.class.to_s.split(/::/).last).to_sym end |