Module: Fog::Compute::HPV2::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
13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/hp/models/compute_v2/meta_parent.rb', line 13 def collection_name if @parent.class == Fog::Compute::HPV2::Image return 'images' elsif @parent.class == Fog::Compute::HPV2::Server return 'servers' else raise 'Metadata is not supported for this model type.' end end |
#metas_to_hash(metas) ⇒ Object
23 24 25 26 27 |
# File 'lib/fog/hp/models/compute_v2/meta_parent.rb', line 23 def () hash = {} .each { || hash.store(.key, .value) } hash end |
#parent ⇒ Object
5 6 7 |
# File 'lib/fog/hp/models/compute_v2/meta_parent.rb', line 5 def parent @parent end |
#parent=(new_parent) ⇒ Object
9 10 11 |
# File 'lib/fog/hp/models/compute_v2/meta_parent.rb', line 9 def parent=(new_parent) @parent = new_parent end |