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

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/openstack/models/identity_v3/policy.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#initialize, #save

Constructor Details

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

Instance Method Details

#createObject


31
32
33
34
35
36
# File 'lib/fog/openstack/models/identity_v3/policy.rb', line 31

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/models/identity_v3/policy.rb', line 18

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

#to_sObject


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

def to_s
  self.name
end

#update(attr = nil) ⇒ Object


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

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