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
21 22 23 24 25 26 27 28 29 |
# File 'lib/fog/rackspace/models/compute_v2/meta_parent.rb', line 21 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
33 34 35 36 37 |
# File 'lib/fog/rackspace/models/compute_v2/meta_parent.rb', line 33 def () hash = {} .each { || hash[.key] = .value } hash end |
#parent ⇒ #parent
Parent of metadata
8 9 10 |
# File 'lib/fog/rackspace/models/compute_v2/meta_parent.rb', line 8 def parent @parent end |
#parent=(new_parent) ⇒ Object
Sets parent of metadata
14 15 16 |
# File 'lib/fog/rackspace/models/compute_v2/meta_parent.rb', line 14 def parent=(new_parent) @parent = new_parent end |