Class: Fog::OpenStack::Identity::V3::Policy

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/openstack/identity/v3/models/policy.rb

Instance Attribute Summary

Attributes inherited from Model

#project

Instance Method Summary collapse

Methods inherited from Model

#initialize, #save

Constructor Details

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

Instance Method Details

#createObject



32
33
34
35
36
37
38
# File 'lib/fog/openstack/identity/v3/models/policy.rb', line 32

def create
  requires :blob, :type
  merge_attributes(
    service.create_policy(attributes).body['policy']
  )
  self
end

#destroyObject



18
19
20
21
22
# File 'lib/fog/openstack/identity/v3/models/policy.rb', line 18

def destroy
  requires :id
  service.delete_policy(id)
  true
end

#to_sObject



14
15
16
# File 'lib/fog/openstack/identity/v3/models/policy.rb', line 14

def to_s
  name
end

#update(attr = nil) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/fog/openstack/identity/v3/models/policy.rb', line 24

def update(attr = nil)
  requires :id, :blob, :type
  merge_attributes(
    service.update_policy(id, attr || attributes).body['policy']
  )
  self
end