Class: Attribute
- Inherits:
-
Object
- Object
- Attribute
- Defined in:
- lib/attribute.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #add_to(command) ⇒ Object
-
#initialize(attribute) ⇒ Attribute
constructor
A new instance of Attribute.
Constructor Details
#initialize(attribute) ⇒ Attribute
Returns a new instance of Attribute.
4 5 6 7 |
# File 'lib/attribute.rb', line 4 def initialize(attribute) @name = attribute['name'] @type = attribute['type'] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/attribute.rb', line 2 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
2 3 4 |
# File 'lib/attribute.rb', line 2 def type @type end |
Class Method Details
.all ⇒ Object
13 14 15 |
# File 'lib/attribute.rb', line 13 def self.all ObjectSpace.each_object(self).to_a end |
Instance Method Details
#add_to(command) ⇒ Object
9 10 11 |
# File 'lib/attribute.rb', line 9 def add_to(command) command << " #{name}:#{type}" end |