Class: AcDc::Attribute
- Inherits:
-
Object
- Object
- AcDc::Attribute
- Defined in:
- lib/acdc/attribute.rb
Overview
Attribute object used in Element and Body. Not often used outside of these.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, value) ⇒ Attribute
constructor
A new instance of Attribute.
-
#to_hash ⇒ Object
Returns the values of this attribute in hash form.
Constructor Details
#initialize(name, value) ⇒ Attribute
Returns a new instance of Attribute.
9 10 11 12 |
# File 'lib/acdc/attribute.rb', line 9 def initialize(name,value) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/acdc/attribute.rb', line 7 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
7 8 9 |
# File 'lib/acdc/attribute.rb', line 7 def value @value end |
Instance Method Details
#to_hash ⇒ Object
Returns the values of this attribute in hash form
15 16 17 |
# File 'lib/acdc/attribute.rb', line 15 def to_hash {@name => @value} end |