Class: DeltaCloud::HWP::Property
- Inherits:
-
Object
- Object
- DeltaCloud::HWP::Property
- Defined in:
- lib/hwp_properties.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(xml, name) ⇒ Property
constructor
A new instance of Property.
- #present? ⇒ Boolean
Constructor Details
#initialize(xml, name) ⇒ Property
Returns a new instance of Property.
26 27 28 29 30 |
# File 'lib/hwp_properties.rb', line 26 def initialize(xml, name) @name, @kind, @value, @unit = xml['name'], xml['kind'].to_sym, xml['value'], xml['unit'] declare_ranges(xml) self end |
Instance Attribute Details
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
24 25 26 |
# File 'lib/hwp_properties.rb', line 24 def kind @kind end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
24 25 26 |
# File 'lib/hwp_properties.rb', line 24 def name @name end |
#unit ⇒ Object (readonly)
Returns the value of attribute unit.
24 25 26 |
# File 'lib/hwp_properties.rb', line 24 def unit @unit end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
24 25 26 |
# File 'lib/hwp_properties.rb', line 24 def value @value end |
Instance Method Details
#present? ⇒ Boolean
32 33 34 |
# File 'lib/hwp_properties.rb', line 32 def present? ! @value.nil? end |