Class: Fog::Brightbox::Compute::Collaborations
- Inherits:
-
Collection
- Object
- Collection
- Fog::Brightbox::Compute::Collaborations
- Defined in:
- lib/fog/brightbox/models/compute/collaborations.rb
Instance Method Summary collapse
- #all ⇒ Object
- #destroy ⇒ Object
- #get(identifier) ⇒ Object
-
#invite(email, role) ⇒ Fog::Brightbox::Compute::Collaboration
Invites a user (via an email) to collaborate on the currently scoped account at the
role
level.
Instance Method Details
#all ⇒ Object
9 10 11 12 |
# File 'lib/fog/brightbox/models/compute/collaborations.rb', line 9 def all data = service.list_collaborations load(data) end |
#destroy ⇒ Object
38 39 40 41 42 |
# File 'lib/fog/brightbox/models/compute/collaborations.rb', line 38 def destroy requires :identity service.delete_collaboration(identity) true end |
#get(identifier) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/fog/brightbox/models/compute/collaborations.rb', line 14 def get(identifier) return nil if identifier.nil? || identifier == "" data = service.get_collaboration(identifier) new(data) rescue Excon::Errors::NotFound nil end |
#invite(email, role) ⇒ Fog::Brightbox::Compute::Collaboration
Invites a user (via an email) to collaborate on the currently scoped account at the role
level.
30 31 32 33 34 35 36 |
# File 'lib/fog/brightbox/models/compute/collaborations.rb', line 30 def invite(email, role) return nil if email.nil? || email == "" return nil if role.nil? || role == "" = { email: email, role: role } data = service.create_collaboration() new(data) end |