Class: Fog::Generators::Compute::VcloudDirector::CreateSnapshot
- Inherits:
-
Object
- Object
- Fog::Generators::Compute::VcloudDirector::CreateSnapshot
- Defined in:
- lib/fog/vcloud_director/generators/compute/create_snapshot.rb
Overview
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
Instance Method Summary collapse
- #generate_xml ⇒ Object
-
#initialize(attrs = {}) ⇒ CreateSnapshot
constructor
A new instance of CreateSnapshot.
Constructor Details
#initialize(attrs = {}) ⇒ CreateSnapshot
Returns a new instance of CreateSnapshot.
9 10 11 |
# File 'lib/fog/vcloud_director/generators/compute/create_snapshot.rb', line 9 def initialize(attrs={}) @attrs = attrs end |
Instance Attribute Details
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
7 8 9 |
# File 'lib/fog/vcloud_director/generators/compute/create_snapshot.rb', line 7 def attrs @attrs end |
Instance Method Details
#generate_xml ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/fog/vcloud_director/generators/compute/create_snapshot.rb', line 13 def generate_xml attrs = @attrs Nokogiri::XML::Builder.new do CreateSnapshotParams('xmlns' => 'http://www.vmware.com/vcloud/v1.5', 'memory' => attrs[:memory], 'name' => attrs[:name], 'quiesce' => attrs[:quiesce]) { Description attrs[:Description] if attrs.key?(:Description) } end.to_xml end |