Class: Tequila::Node::Attribute
- Inherits:
-
Object
- Object
- Tequila::Node::Attribute
- Defined in:
- lib/tree.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Attribute
constructor
A new instance of Attribute.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ Attribute
Returns a new instance of Attribute.
181 182 183 184 |
# File 'lib/tree.rb', line 181 def initialize(name) @name = name @label = name end |
Instance Attribute Details
#label ⇒ Object
Returns the value of attribute label.
178 179 180 |
# File 'lib/tree.rb', line 178 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
179 180 181 |
# File 'lib/tree.rb', line 179 def name @name end |
Instance Method Details
#to_s ⇒ Object
186 187 188 189 |
# File 'lib/tree.rb', line 186 def to_s name == label ? name : "#{name}(#{label}) " end |