class Trello::Member

A Member is a user of the Trello service.

@!attribute [r] id

@return [String]

@!attribute [r] username

@return [String]

@!attribute [rw] email

@return [String]

@!attribute [rw] full_name

@return [String]

@!attribute [rw] initials

@return [String]

@!attribute [r] avatar_id

@return [String]

@!attribute [rw] bio

@return [String]

@!attribute [r] url

@return [String]

Public Class Methods

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

Finds a user

The argument may be specified as either an id or a username.

# File lib/trello/member.rb, line 32
def find(id_or_username, params = {})
  client.find(:member, id_or_username, params)
end

Public Instance Methods

avatar_url(options = { size: :large }) click to toggle source

Retrieve a URL to the avatar.

Valid values for options are:

:large (170x170)
:small (30x30)
# File lib/trello/member.rb, line 58
def avatar_url(options = { size: :large })
  size = options[:size] == :small ? 30 : 170
  "https://trello-avatars.s3.amazonaws.com/#{avatar_id}/#{size}.png"
end
save() click to toggle source
# File lib/trello/member.rb, line 93
def save
  @previously_changed = changes
  @changed_attributes.clear

  return update! if id
end
update!() click to toggle source
# File lib/trello/member.rb, line 100
def update!
  from_response client.put(request_prefix, {
    fullName: full_name,
    bio: bio
  })
end
update_fields(fields) click to toggle source

Update the fields of a member.

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

# File lib/trello/member.rb, line 41
def update_fields(fields)
  attributes[:id]        = fields['id']
  attributes[:full_name] = fields['fullName']
  attributes[:email]     = fields['email']
  attributes[:username]  = fields['username']
  attributes[:initials]  = fields['initials']
  attributes[:avatar_id] = fields['avatarHash']
  attributes[:bio]       = fields['bio']
  attributes[:url]       = fields['url']
  self
end