Class: Fog::Hyperv::VMCollection
Instance Attribute Summary collapse
#cluster, #computer
Class Method Summary
collapse
Instance Method Summary
collapse
requires_computer
Methods inherited from Collection
#all, #create, #get, get_method, requires, requires?
Instance Attribute Details
#vm ⇒ Object
Returns the value of attribute vm.
108
109
110
|
# File 'lib/fog/collection.rb', line 108
def vm
@vm
end
|
Class Method Details
.match_on(attr = nil) ⇒ Object
100
101
102
|
# File 'lib/fog/collection.rb', line 100
def self.match_on(attr = nil)
@match_on ||= attr
end
|
.requires_vm ⇒ Object
104
105
106
|
# File 'lib/fog/collection.rb', line 104
def self.requires_vm
requires << :vm
end
|
Instance Method Details
#inspect ⇒ Object
119
120
121
122
|
# File 'lib/fog/collection.rb', line 119
def inspect
to_s
end
|
#new(attributes = {}) ⇒ Object
110
111
112
113
114
115
116
117
|
# File 'lib/fog/collection.rb', line 110
def new(attributes = {})
object = super
object.computer_name ||= vm.computer_name if vm && object.respond_to?(:computer_name)
object.vm_id ||= vm.id if vm && object.respond_to?(:vm_id)
object.vm_name ||= vm.name if vm && object.respond_to?(:vm_name)
object
end
|