Class: Linguist::Models::Collaborator
- Inherits:
-
Object
- Object
- Linguist::Models::Collaborator
- Defined in:
- lib/linguist_ruby/models/collaborator.rb
Constant Summary collapse
- ROLES_NAMES =
{ "project_admin" => "Project admin", "developer" => "Developer" }
Instance Attribute Summary collapse
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#email ⇒ Object
Returns the value of attribute email.
-
#roles ⇒ Object
Returns the value of attribute roles.
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(client, link) ⇒ Collaborator
constructor
A new instance of Collaborator.
- #permissions ⇒ Object
Constructor Details
#initialize(client, link) ⇒ Collaborator
Returns a new instance of Collaborator.
8 9 10 11 |
# File 'lib/linguist_ruby/models/collaborator.rb', line 8 def initialize(client, link) @client = client @link = link end |
Instance Attribute Details
#display_name ⇒ Object
Returns the value of attribute display_name.
4 5 6 |
# File 'lib/linguist_ruby/models/collaborator.rb', line 4 def display_name @display_name end |
#email ⇒ Object
Returns the value of attribute email.
4 5 6 |
# File 'lib/linguist_ruby/models/collaborator.rb', line 4 def email @email end |
#roles ⇒ Object
Returns the value of attribute roles.
4 5 6 |
# File 'lib/linguist_ruby/models/collaborator.rb', line 4 def roles @roles end |
Instance Method Details
#destroy ⇒ Object
13 14 15 |
# File 'lib/linguist_ruby/models/collaborator.rb', line 13 def destroy @client.delete @link end |
#permissions ⇒ Object
17 18 19 20 21 |
# File 'lib/linguist_ruby/models/collaborator.rb', line 17 def return "None" if self.roles.nil? or self.roles.empty? self.roles.find_all { |role| ROLES_NAMES.has_key?(role) }.join(", ") end |