Class: Fog::Generators::Compute::VcloudDirector::Vapp

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/vcloud_director/generators/compute/vapp.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ Vapp

Returns a new instance of Vapp.



10
11
12
13
# File 'lib/fog/vcloud_director/generators/compute/vapp.rb', line 10

def initialize(name, options={})
  @name = name
  @options = options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/fog/vcloud_director/generators/compute/vapp.rb', line 8

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/fog/vcloud_director/generators/compute/vapp.rb', line 8

def options
  @options
end

Instance Method Details

#generate_xmlObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/fog/vcloud_director/generators/compute/vapp.rb', line 15

def generate_xml
  attrs = @attrs
  Nokogiri::XML::Builder.new do
    VApp('xmlns' => 'http://www.vmware.com/vcloud/v1.5',
         'name' => name
        ) {
      Description options[:Description] if options.key?(:Description)
    }
  end.to_xml
end