Class: Fog::ContainerInfra::OpenStack::Base

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/container_infra/openstack/models/base.rb

Direct Known Subclasses

Bay, BayModel, Certificate, Cluster, ClusterTemplate

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#create, #destroy, #initialize, #save, #update

Constructor Details

This class inherits a constructor from Fog::OpenStack::Model

Instance Method Details

#convert_update_params(params) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/fog/container_infra/openstack/models/base.rb', line 7

def convert_update_params(params)
  params = params.map do |key, value|
  {
    "path"  => "/#{key}",
    "op"    => value ? "replace" : "remove"
  }.merge(value ? {"value" => value} : {})
  end
  params.each {|k,v| params[k] = v.to_s.capitalize if [true, false].include?(v)} 
end