class Trello::Organization

Organizations are useful for linking members together.

@!attribute [r] id

@return [String]

@!attribute [r] name

@return [String]

@!attribute [r] display_name

@return [String]

@!attribute [r] description

@return [String]

@!attribute [r] url

@return [String]

Public Class Methods

find(id, params = {}) click to toggle source

Find an organization by its id.

# File lib/trello/organization.rb, line 27
def find(id, params = {})
  client.find(:organization, id, params)
end

Public Instance Methods

boards() click to toggle source

Returns a list of boards under this organization.

# File lib/trello/organization.rb, line 52
def boards
  boards = Board.from_response client.get("/organizations/#{id}/boards/all")
  MultiAssociation.new(self, boards).proxy
end
members(params = {}) click to toggle source

Returns an array of members associated with the organization.

# File lib/trello/organization.rb, line 58
def members(params = {})
  members = Member.from_response client.get("/organizations/#{id}/members/all", params)
  MultiAssociation.new(self, members).proxy
end
update_fields(fields) click to toggle source

Update the fields of an organization.

Supply a hash of string keyed data retrieved from the Trello API representing an Organization.

# File lib/trello/organization.rb, line 36
def update_fields(fields)
  attributes[:id]                           = fields['id'] || attributes[:id]
  attributes[:name]                         = fields['name'] || attributes[:name]
  attributes[:display_name]                 = fields['displayName'] || attributes[:display_name]
  attributes[:description]                  = fields['desc'] || attributes[:description]
  attributes[:url]                          = fields['url'] || attributes[:url]
  attributes[:invited]                      = fields['invited'] if fields.has_key?('invited')
  attributes[:website]                      = fields['website'] || attributes[:website]
  attributes[:logo_hash]                    = fields['logoHash'] || attributes[:logo_hash]
  attributes[:billable_member_count]        = fields['billableMemberCount'] || attributes[:billable_member_count]
  attributes[:active_billable_member_count] = fields['activeBillableMemberCount'] || attributes[:active_billable_member_count]
  attributes[:memberships]                  = fields['memberships'] || attributes[:memberships]
  self
end