Class: Fog::Attributes::Hypervenumarray
- Inherits:
-
Default
- Object
- Default
- Fog::Attributes::Hypervenumarray
- Defined in:
- lib/fog/hyperv/fog_extensions/attributes/enumarray.rb
Overview
Fog attribute type for handling arrays of enums from PowerShell, where each value might be returned as a number or string depending on the context
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(model, name, options) ⇒ Hypervenumarray
constructor
A new instance of Hypervenumarray.
Constructor Details
#initialize(model, name, options) ⇒ Hypervenumarray
Returns a new instance of Hypervenumarray.
9 10 11 12 13 14 15 16 |
# File 'lib/fog/hyperv/fog_extensions/attributes/enumarray.rb', line 9 def initialize(model, name, ) @values = .fetch(:values, []) raise Fog::Hyperv::Errors::ServiceError, "#{values} is not a valid array or hash" \ unless %w[Array Hash].include?(values.class.to_s) super end |
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
7 8 9 |
# File 'lib/fog/hyperv/fog_extensions/attributes/enumarray.rb', line 7 def values @values end |