Class: DeltaCloud::HWP::Property

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

Direct Known Subclasses

FloatProperty

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Property) initialize(xml, name)

A new instance of Property



448
449
450
451
452
# File 'lib/deltacloud.rb', line 448

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

- (Object) kind (readonly)

Returns the value of attribute kind



446
447
448
# File 'lib/deltacloud.rb', line 446

def kind
  @kind
end

- (Object) name (readonly)

Returns the value of attribute name



446
447
448
# File 'lib/deltacloud.rb', line 446

def name
  @name
end

- (Object) unit (readonly)

Returns the value of attribute unit



446
447
448
# File 'lib/deltacloud.rb', line 446

def unit
  @unit
end

- (Object) value (readonly)

Returns the value of attribute value



446
447
448
# File 'lib/deltacloud.rb', line 446

def value
  @value
end

Instance Method Details

- (Boolean) present?

Returns:

  • (Boolean)


454
455
456
# File 'lib/deltacloud.rb', line 454

def present?
  ! @value.nil?
end