Class: VagrantPlugins::Skytap::API::PublishSet
Instance Attribute Summary collapse
Attributes inherited from Resource
#attrs, #env
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Resource
#delete, #refresh, #reload, short_name, #update, #url
#get_api_attribute, included
Constructor Details
#initialize(attrs, environment, env) ⇒ PublishSet
Returns a new instance of PublishSet.
37
38
39
40
|
# File 'lib/vagrant-skytap/api/publish_set.rb', line 37
def initialize(attrs, environment, env)
super
@environment = environment
end
|
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
30
31
32
|
# File 'lib/vagrant-skytap/api/publish_set.rb', line 30
def environment
@environment
end
|
Class Method Details
.rest_name ⇒ Object
33
34
35
|
# File 'lib/vagrant-skytap/api/publish_set.rb', line 33
def self.rest_name
"publish_set"
end
|
Instance Method Details
#password_protected? ⇒ Boolean
42
43
44
45
|
# File 'lib/vagrant-skytap/api/publish_set.rb', line 42
def password_protected?
get_api_attribute('password').present?
end
|
47
48
49
50
|
# File 'lib/vagrant-skytap/api/publish_set.rb', line 47
def vm_ids
vm_refs = get_api_attribute("vms").collect{|ref| ref['vm_ref']}
vm_refs.collect{|ref| ref.match(/\/vms\/(\d+)/)}.compact.map{|match| match[1]}
end
|
52
53
54
|
# File 'lib/vagrant-skytap/api/publish_set.rb', line 52
def vms
environment.get_vms_by_id(vm_ids)
end
|