Class: Org::Token
- Inherits:
-
Object
- Object
- Org::Token
- Defined in:
- lib/org/token.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#childs ⇒ Object
Returns the value of attribute childs.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#values ⇒ Object
Returns the value of attribute values.
Instance Method Summary collapse
- #<<(token) ⇒ Object
-
#initialize(name, values, options = {}, &block) ⇒ Token
constructor
A new instance of Token.
- #pretty_inspect ⇒ Object (also: #inspect)
Constructor Details
#initialize(name, values, options = {}, &block) ⇒ Token
Returns a new instance of Token.
5 6 7 8 |
# File 'lib/org/token.rb', line 5 def initialize(name, values, = {}, &block) @name, @values, , @block = name, values, , block @childs = [] end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
3 4 5 |
# File 'lib/org/token.rb', line 3 def block @block end |
#childs ⇒ Object
Returns the value of attribute childs.
3 4 5 |
# File 'lib/org/token.rb', line 3 def childs @childs end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/org/token.rb', line 3 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/org/token.rb', line 3 def end |
#parent ⇒ Object
Returns the value of attribute parent.
3 4 5 |
# File 'lib/org/token.rb', line 3 def parent @parent end |
#values ⇒ Object
Returns the value of attribute values.
3 4 5 |
# File 'lib/org/token.rb', line 3 def values @values end |
Instance Method Details
#<<(token) ⇒ Object
10 11 12 13 |
# File 'lib/org/token.rb', line 10 def <<(token) token.parent = self @childs << token end |
#pretty_inspect ⇒ Object Also known as: inspect
15 16 17 |
# File 'lib/org/token.rb', line 15 def pretty_inspect {[name, values] => childs}.pretty_inspect end |