Class: DeltaCloud::HWP::Property

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

Direct Known Subclasses

FloatProperty

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#kindObject (readonly)

Returns the value of attribute kind.



24
25
26
# File 'lib/hwp_properties.rb', line 24

def kind
  @kind
end

#nameObject (readonly)

Returns the value of attribute name.



24
25
26
# File 'lib/hwp_properties.rb', line 24

def name
  @name
end

#unitObject (readonly)

Returns the value of attribute unit.



24
25
26
# File 'lib/hwp_properties.rb', line 24

def unit
  @unit
end

#valueObject (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

Returns:

  • (Boolean)


32
33
34
# File 'lib/hwp_properties.rb', line 32

def present?
  ! @value.nil?
end