Class: Fog::Compute::Brightbox::Collaborations
- Inherits:
-
Fog::Collection
- Object
- Array
- Fog::Collection
- Fog::Compute::Brightbox::Collaborations
- Defined in:
- lib/fog/brightbox/models/compute/collaborations.rb
Instance Attribute Summary
Attributes inherited from Fog::Collection
Instance Method Summary collapse
- #all ⇒ Object
- #destroy ⇒ Object
- #get(identifier) ⇒ Object
-
#invite(email, role) ⇒ Fog::Compute::Brightbox::Collaboration
Invites a user (via an email) to collaborate on the currently scoped account at the
role
level.
Methods inherited from Fog::Collection
#clear, #create, #initialize, #inspect, #load, model, #model, #new, #reload, #table, #to_json
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Fog::Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Collection
Instance Method Details
#all ⇒ Object
10 11 12 13 |
# File 'lib/fog/brightbox/models/compute/collaborations.rb', line 10 def all data = service.list_collaborations load(data) end |
#destroy ⇒ Object
39 40 41 42 43 |
# File 'lib/fog/brightbox/models/compute/collaborations.rb', line 39 def destroy requires :identity service.destroy_collaboration(identity) true end |
#get(identifier) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/fog/brightbox/models/compute/collaborations.rb', line 15 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::Compute::Brightbox::Collaboration
Invites a user (via an email) to collaborate on the currently scoped account at the role
level.
31 32 33 34 35 36 37 |
# File 'lib/fog/brightbox/models/compute/collaborations.rb', line 31 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 |