mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
use std options={} format for optional parameters
This commit is contained in:
parent
1e92536eaf
commit
1153824067
2 changed files with 7 additions and 7 deletions
|
@ -3,13 +3,13 @@ module Fog
|
|||
module Compute
|
||||
module VcloudDirector
|
||||
|
||||
# @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/types/VmType.html
|
||||
# @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/types/VAppType.html
|
||||
class Vapp
|
||||
attr_reader :name, :description
|
||||
attr_reader :name, :options
|
||||
|
||||
def initialize(name, description=nil)
|
||||
def initialize(name, options={})
|
||||
@name = name
|
||||
@description = description
|
||||
@options = options
|
||||
end
|
||||
|
||||
def generate_xml
|
||||
|
@ -18,7 +18,7 @@ module Fog
|
|||
VApp('xmlns' => 'http://www.vmware.com/vcloud/v1.5',
|
||||
'name' => name
|
||||
) {
|
||||
Description description unless description.nil?
|
||||
Description options[:Description] if options.key?(:Description)
|
||||
}
|
||||
end.to_xml
|
||||
end
|
||||
|
|
|
@ -19,8 +19,8 @@ module Fog
|
|||
#
|
||||
# @see http://pubs.vmware.com/vcd-55/topic/com.vmware.vcloud.api.reference.doc_55/doc/operations/PUT-VAppNameAndDescription.html
|
||||
# @since vCloud API version 0.9
|
||||
def put_vapp_name_and_description(id, name, description=nil)
|
||||
body = Fog::Generators::Compute::VcloudDirector::Vapp.new(name, description).generate_xml
|
||||
def put_vapp_name_and_description(id, name, options={})
|
||||
body = Fog::Generators::Compute::VcloudDirector::Vapp.new(name, options).generate_xml
|
||||
request(
|
||||
:body => body,
|
||||
:expects => 202,
|
||||
|
|
Loading…
Reference in a new issue