Class: Trello::Organization
- Includes:
- HasActions
- Defined in:
- lib/trello/organization.rb
Overview
Organizations are useful for linking members together.
Instance Attribute Summary collapse
- #description ⇒ String readonly
- #display_name ⇒ String readonly
- #id ⇒ String readonly
- #name ⇒ String readonly
- #url ⇒ String readonly
Attributes inherited from BasicData
Class Method Summary collapse
-
.find(id, params = {}) ⇒ Object
Find an organization by its id.
Instance Method Summary collapse
-
#boards ⇒ Object
Returns a list of boards under this organization.
-
#members(params = {}) ⇒ Object
Returns an array of members associated with the organization.
-
#request_prefix ⇒ Object
:nodoc:.
-
#update_fields(fields) ⇒ Object
Update the fields of an organization.
Methods included from HasActions
Methods inherited from BasicData
#==, client, create, #initialize, many, one, parse, parse_many, path_name, #refresh!, register_attributes, save
Constructor Details
This class inherits a constructor from Trello::BasicData
Instance Attribute Details
#description ⇒ String (readonly)
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/trello/organization.rb', line 14 class Organization < BasicData register_attributes :id, :name, :display_name, :description, :url, :invited, :website, :logo_hash, :billable_member_count, :active_billable_member_count, readonly: [ :id, :name, :display_name, :description, :url, :invited, :website, :logo_hash, :billable_member_count, :active_billable_member_count ] validates_presence_of :id, :name include HasActions class << self # Find an organization by its id. def find(id, params = {}) client.find(:organization, id, params) end end # Update the fields of an organization. # # Supply a hash of string keyed data retrieved from the Trello API representing # an Organization. def update_fields(fields) attributes[:id] = fields['id'] attributes[:name] = fields['name'] attributes[:display_name] = fields['displayName'] attributes[:description] = fields['desc'] attributes[:url] = fields['url'] attributes[:invited] = fields['invited'] attributes[:website] = fields['website'] attributes[:logo_hash] = fields['logoHash'] attributes[:billable_member_count] = fields['billableMemberCount'] attributes[:active_billable_member_count] = fields['activeBillableMemberCount'] self end # Returns a list of boards under this organization. def boards boards = client.get("/organizations/#{id}/boards/all").json_into(Board) MultiAssociation.new(self, boards).proxy end # Returns an array of members associated with the organization. def members(params = {}) members = client.get("/organizations/#{id}/members/all", params).json_into(Member) MultiAssociation.new(self, members).proxy end # :nodoc: def request_prefix "/organizations/#{id}" end end |
#display_name ⇒ String (readonly)
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/trello/organization.rb', line 14 class Organization < BasicData register_attributes :id, :name, :display_name, :description, :url, :invited, :website, :logo_hash, :billable_member_count, :active_billable_member_count, readonly: [ :id, :name, :display_name, :description, :url, :invited, :website, :logo_hash, :billable_member_count, :active_billable_member_count ] validates_presence_of :id, :name include HasActions class << self # Find an organization by its id. def find(id, params = {}) client.find(:organization, id, params) end end # Update the fields of an organization. # # Supply a hash of string keyed data retrieved from the Trello API representing # an Organization. def update_fields(fields) attributes[:id] = fields['id'] attributes[:name] = fields['name'] attributes[:display_name] = fields['displayName'] attributes[:description] = fields['desc'] attributes[:url] = fields['url'] attributes[:invited] = fields['invited'] attributes[:website] = fields['website'] attributes[:logo_hash] = fields['logoHash'] attributes[:billable_member_count] = fields['billableMemberCount'] attributes[:active_billable_member_count] = fields['activeBillableMemberCount'] self end # Returns a list of boards under this organization. def boards boards = client.get("/organizations/#{id}/boards/all").json_into(Board) MultiAssociation.new(self, boards).proxy end # Returns an array of members associated with the organization. def members(params = {}) members = client.get("/organizations/#{id}/members/all", params).json_into(Member) MultiAssociation.new(self, members).proxy end # :nodoc: def request_prefix "/organizations/#{id}" end end |
#id ⇒ String (readonly)
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/trello/organization.rb', line 14 class Organization < BasicData register_attributes :id, :name, :display_name, :description, :url, :invited, :website, :logo_hash, :billable_member_count, :active_billable_member_count, readonly: [ :id, :name, :display_name, :description, :url, :invited, :website, :logo_hash, :billable_member_count, :active_billable_member_count ] validates_presence_of :id, :name include HasActions class << self # Find an organization by its id. def find(id, params = {}) client.find(:organization, id, params) end end # Update the fields of an organization. # # Supply a hash of string keyed data retrieved from the Trello API representing # an Organization. def update_fields(fields) attributes[:id] = fields['id'] attributes[:name] = fields['name'] attributes[:display_name] = fields['displayName'] attributes[:description] = fields['desc'] attributes[:url] = fields['url'] attributes[:invited] = fields['invited'] attributes[:website] = fields['website'] attributes[:logo_hash] = fields['logoHash'] attributes[:billable_member_count] = fields['billableMemberCount'] attributes[:active_billable_member_count] = fields['activeBillableMemberCount'] self end # Returns a list of boards under this organization. def boards boards = client.get("/organizations/#{id}/boards/all").json_into(Board) MultiAssociation.new(self, boards).proxy end # Returns an array of members associated with the organization. def members(params = {}) members = client.get("/organizations/#{id}/members/all", params).json_into(Member) MultiAssociation.new(self, members).proxy end # :nodoc: def request_prefix "/organizations/#{id}" end end |
#name ⇒ String (readonly)
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/trello/organization.rb', line 14 class Organization < BasicData register_attributes :id, :name, :display_name, :description, :url, :invited, :website, :logo_hash, :billable_member_count, :active_billable_member_count, readonly: [ :id, :name, :display_name, :description, :url, :invited, :website, :logo_hash, :billable_member_count, :active_billable_member_count ] validates_presence_of :id, :name include HasActions class << self # Find an organization by its id. def find(id, params = {}) client.find(:organization, id, params) end end # Update the fields of an organization. # # Supply a hash of string keyed data retrieved from the Trello API representing # an Organization. def update_fields(fields) attributes[:id] = fields['id'] attributes[:name] = fields['name'] attributes[:display_name] = fields['displayName'] attributes[:description] = fields['desc'] attributes[:url] = fields['url'] attributes[:invited] = fields['invited'] attributes[:website] = fields['website'] attributes[:logo_hash] = fields['logoHash'] attributes[:billable_member_count] = fields['billableMemberCount'] attributes[:active_billable_member_count] = fields['activeBillableMemberCount'] self end # Returns a list of boards under this organization. def boards boards = client.get("/organizations/#{id}/boards/all").json_into(Board) MultiAssociation.new(self, boards).proxy end # Returns an array of members associated with the organization. def members(params = {}) members = client.get("/organizations/#{id}/members/all", params).json_into(Member) MultiAssociation.new(self, members).proxy end # :nodoc: def request_prefix "/organizations/#{id}" end end |
#url ⇒ String (readonly)
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/trello/organization.rb', line 14 class Organization < BasicData register_attributes :id, :name, :display_name, :description, :url, :invited, :website, :logo_hash, :billable_member_count, :active_billable_member_count, readonly: [ :id, :name, :display_name, :description, :url, :invited, :website, :logo_hash, :billable_member_count, :active_billable_member_count ] validates_presence_of :id, :name include HasActions class << self # Find an organization by its id. def find(id, params = {}) client.find(:organization, id, params) end end # Update the fields of an organization. # # Supply a hash of string keyed data retrieved from the Trello API representing # an Organization. def update_fields(fields) attributes[:id] = fields['id'] attributes[:name] = fields['name'] attributes[:display_name] = fields['displayName'] attributes[:description] = fields['desc'] attributes[:url] = fields['url'] attributes[:invited] = fields['invited'] attributes[:website] = fields['website'] attributes[:logo_hash] = fields['logoHash'] attributes[:billable_member_count] = fields['billableMemberCount'] attributes[:active_billable_member_count] = fields['activeBillableMemberCount'] self end # Returns a list of boards under this organization. def boards boards = client.get("/organizations/#{id}/boards/all").json_into(Board) MultiAssociation.new(self, boards).proxy end # Returns an array of members associated with the organization. def members(params = {}) members = client.get("/organizations/#{id}/members/all", params).json_into(Member) MultiAssociation.new(self, members).proxy end # :nodoc: def request_prefix "/organizations/#{id}" end end |
Class Method Details
.find(id, params = {}) ⇒ Object
Find an organization by its id.
25 26 27 |
# File 'lib/trello/organization.rb', line 25 def find(id, params = {}) client.find(:organization, id, params) end |
Instance Method Details
#boards ⇒ Object
Returns a list of boards under this organization.
49 50 51 52 |
# File 'lib/trello/organization.rb', line 49 def boards boards = client.get("/organizations/#{id}/boards/all").json_into(Board) MultiAssociation.new(self, boards).proxy end |
#members(params = {}) ⇒ Object
Returns an array of members associated with the organization.
55 56 57 58 |
# File 'lib/trello/organization.rb', line 55 def members(params = {}) members = client.get("/organizations/#{id}/members/all", params).json_into(Member) MultiAssociation.new(self, members).proxy end |
#request_prefix ⇒ Object
:nodoc:
61 62 63 |
# File 'lib/trello/organization.rb', line 61 def request_prefix "/organizations/#{id}" end |
#update_fields(fields) ⇒ Object
Update the fields of an organization.
Supply a hash of string keyed data retrieved from the Trello API representing an Organization.
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/trello/organization.rb', line 34 def update_fields(fields) attributes[:id] = fields['id'] attributes[:name] = fields['name'] attributes[:display_name] = fields['displayName'] attributes[:description] = fields['desc'] attributes[:url] = fields['url'] attributes[:invited] = fields['invited'] attributes[:website] = fields['website'] attributes[:logo_hash] = fields['logoHash'] attributes[:billable_member_count] = fields['billableMemberCount'] attributes[:active_billable_member_count] = fields['activeBillableMemberCount'] self end |