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.



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

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.



21
22
23
# File 'lib/hwp_properties.rb', line 21

def kind
  @kind
end

#nameObject (readonly)

Returns the value of attribute name.



21
22
23
# File 'lib/hwp_properties.rb', line 21

def name
  @name
end

#unitObject (readonly)

Returns the value of attribute unit.



21
22
23
# File 'lib/hwp_properties.rb', line 21

def unit
  @unit
end

#valueObject (readonly)

Returns the value of attribute value.



21
22
23
# File 'lib/hwp_properties.rb', line 21

def value
  @value
end

Instance Method Details

#present?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/hwp_properties.rb', line 29

def present?
  ! @value.nil?
end