Module: Fog::Compute::RackspaceV2::MetaParent
Instance Method Summary collapse
-
#collection_name ⇒ String
Collection type for parent.
-
#metas_to_hash(metas) ⇒ Hash
Converts metadata to hash.
-
#parent ⇒ #parent
Parent of metadata.
-
#parent=(new_parent) ⇒ Object
Sets parent of metadata.
Instance Method Details
#collection_name ⇒ String
Collection type for parent
20 21 22 23 24 25 26 27 28 |
# File 'lib/fog/rackspace/models/compute_v2/meta_parent.rb', line 20 def collection_name if parent.class == Fog::Compute::RackspaceV2::Image return "images" elsif parent.class == Fog::Compute::RackspaceV2::Server return "servers" else raise "Metadata is not supported for this model type." end end |
#metas_to_hash(metas) ⇒ Hash
Converts metadata to hash
32 33 34 35 36 |
# File 'lib/fog/rackspace/models/compute_v2/meta_parent.rb', line 32 def () hash = {} .each { || hash[.key] = .value } hash end |
#parent ⇒ #parent
Parent of metadata
7 8 9 |
# File 'lib/fog/rackspace/models/compute_v2/meta_parent.rb', line 7 def parent @parent end |
#parent=(new_parent) ⇒ Object
Sets parent of metadata
13 14 15 |
# File 'lib/fog/rackspace/models/compute_v2/meta_parent.rb', line 13 def parent=(new_parent) @parent = new_parent end |