Class: Tequila::Node::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#labelObject

Returns the value of attribute label.



178
179
180
# File 'lib/tree.rb', line 178

def label
  @label
end

#nameObject (readonly)

Returns the value of attribute name.



179
180
181
# File 'lib/tree.rb', line 179

def name
  @name
end

Instance Method Details

#to_sObject



186
187
188
189
# File 'lib/tree.rb', line 186

def to_s
  name == label ?
  name : "#{name}(#{label}) "
end