Class: DeltacloudVM::Client::Helpers::Property::Enum
- Includes:
- Enumerable
- Defined in:
- lib/deltacloud_vm/client/helpers/property_helper.rb
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Attributes inherited from Property
Class Method Summary collapse
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(name, unit, values, default = nil) ⇒ Enum
constructor
A new instance of Enum.
- #value ⇒ Object
Methods inherited from Property
Constructor Details
#initialize(name, unit, values, default = nil) ⇒ Enum
Returns a new instance of Enum.
67 68 69 70 |
# File 'lib/deltacloud_vm/client/helpers/property_helper.rb', line 67 def initialize(name, unit, values, default=nil) @values = values super(name, unit, default) end |
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
65 66 67 |
# File 'lib/deltacloud_vm/client/helpers/property_helper.rb', line 65 def values @values end |
Class Method Details
.parse(body) ⇒ Object
80 81 82 83 |
# File 'lib/deltacloud_vm/client/helpers/property_helper.rb', line 80 def self.parse(body) base = super new(base.name, base.unit, body.xpath('enum/entry').map { |e| e['value'] }, base.default) end |
Instance Method Details
#each ⇒ Object
76 77 78 |
# File 'lib/deltacloud_vm/client/helpers/property_helper.rb', line 76 def each value.each end |
#value ⇒ Object
72 73 74 |
# File 'lib/deltacloud_vm/client/helpers/property_helper.rb', line 72 def value @values end |