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

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

Direct Known Subclasses

Bay, BayModel, Certificate, Cluster, ClusterTemplate

Instance Attribute Summary

Attributes inherited from Model

#project

Instance Method Summary collapse

Methods inherited from 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/openstack/container_infra/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