Class: Fog::Attributes::Hypervenum
- Inherits:
-
Default
- Object
- Default
- Fog::Attributes::Hypervenum
- Defined in:
- lib/fog/hyperv/fog_extensions/attributes/enum.rb
Overview
Fog attribute type for handling enums from PowelShell, where the value might be 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) ⇒ Hypervenum
constructor
A new instance of Hypervenum.
Constructor Details
#initialize(model, name, options) ⇒ Hypervenum
Returns a new instance of Hypervenum.
9 10 11 12 13 14 15 16 |
# File 'lib/fog/hyperv/fog_extensions/attributes/enum.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/enum.rb', line 7 def values @values end |