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.



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

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#generate_xmlObject



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

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