Module: Fog::Compute::HP::MetaParent
Instance Method Summary collapse
- #collection_name ⇒ Object
- #metas_to_hash(metas) ⇒ Object
- #parent ⇒ Object
- #parent=(new_parent) ⇒ Object
Instance Method Details
#collection_name ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/hp/models/meta_parent.rb', line 14 def collection_name if @parent.class == Fog::Compute::HP::Image return "images" elsif @parent.class == Fog::Compute::HP::Server return "servers" else raise "Metadata is not supported for this model type." end end |
#metas_to_hash(metas) ⇒ Object
24 25 26 27 28 |
# File 'lib/fog/hp/models/meta_parent.rb', line 24 def () hash = {} .each { || hash.store(.key, .value) } hash end |
#parent ⇒ Object
6 7 8 |
# File 'lib/fog/hp/models/meta_parent.rb', line 6 def parent @parent end |
#parent=(new_parent) ⇒ Object
10 11 12 |
# File 'lib/fog/hp/models/meta_parent.rb', line 10 def parent=(new_parent) @parent = new_parent end |