Class: Fog::Hyperv::Model
- Inherits:
-
Model
- Object
- Model
- Fog::Hyperv::Model
- Extended by:
- ModelExtends
- Includes:
- ModelIncludes
- Defined in:
- lib/fog/hyperv/model.rb
Overview
A slightly specialized Fog::Model which includes shared Hyper-V functionality
Direct Known Subclasses
Compute::Bios, Compute::Cluster, Compute::ComPort, Compute::DvdDrive, Compute::Firmware, Compute::FloppyDrive, Compute::HardDrive, Compute::Host, Compute::NetworkAdapter, Compute::NetworkAdapterVlan, Compute::Security, Compute::Switch, Compute::Vhd
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Model
constructor
A new instance of Model.
- #merge_attributes(attributes = {}) ⇒ Object
Methods included from ModelExtends
Methods included from ModelIncludes
#cluster, #computer, #dirty, #dirty?, #vm
Constructor Details
#initialize(attributes = {}) ⇒ Model
Returns a new instance of Model.
122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/fog/hyperv/model.rb', line 122 def initialize(attributes = {}) @vm = attributes.delete :vm self.attributes[:vm] = @vm if self.class.attributes.include? :vm @computer = attributes.delete :computer self.attributes[:computer] = @computer if self.class.attributes.include? :computer @cluster = attributes.delete :cluster self.attributes[:cluster] = @cluster if self.class.attributes.include? :cluster super @old = dup if persisted? end |
Instance Method Details
#merge_attributes(attributes = {}) ⇒ Object
135 136 137 138 139 140 |
# File 'lib/fog/hyperv/model.rb', line 135 def merge_attributes(attributes = {}) super @old = dup self end |