Class: Fog::Identity::OpenStack::V3::Role
- Inherits:
-
Model
- Object
- Model
- Fog::Identity::OpenStack::V3::Role
- Defined in:
- lib/fog/openstack/models/identity_v3/role.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
35 36 37 38 39 |
# File 'lib/fog/openstack/models/identity_v3/role.rb', line 35 def create merge_attributes( service.create_role(attributes).body['role']) self end |
#destroy ⇒ Object
17 18 19 20 21 |
# File 'lib/fog/openstack/models/identity_v3/role.rb', line 17 def destroy requires :id service.delete_role(self.id) true end |
#save ⇒ Object
30 31 32 33 |
# File 'lib/fog/openstack/models/identity_v3/role.rb', line 30 def save requires :name identity ? update : create end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/fog/openstack/models/identity_v3/role.rb', line 13 def to_s self.name end |
#update(attr = nil) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/fog/openstack/models/identity_v3/role.rb', line 23 def update(attr = nil) requires :id merge_attributes( service.update_role(self.id, attr || attributes).body['role']) self end |