Module: Tacokit::Client::Members

Included in:
Tacokit::Client
Defined in:
lib/tacokit/client/members.rb

Overview

Methods for the Members API

See Also:

Instance Method Summary (collapse)

Instance Method Details

- (Tacokit::Collection<Action>) actions(username = "me", options = nil) - (Tacokit::Collection) actions(options = nil) Also known as: member_actions

Overloads:

  • - (Tacokit::Collection<Action>) actions(username = "me", options = nil)

    Retrieve a member's actions

    Examples:

    fetch the actions for the member named 'tacokit'

    Tacokit.actions("tacokit") #=> Tacokit::Collection<Member>

    Parameters:

    • username (String, Tacokit::Resource<Member>) (defaults to: "me")

      the username or member resource

    • options (Hash) (defaults to: nil)

      the options to fetch the actions with

    Returns:

  • - (Tacokit::Collection) actions(options = nil)

    Retrieve the current member's actions

    Examples:

    fetch the current member's actions

    Tacokit.actions #=> Tacokit::Collection<Action>

    fetch the current member's card comment actions only

    Tacokit.actions(filter: "comment_card") #=> Tacokit::Collection<Action>

    Parameters:

    • options (Hash) (defaults to: nil)

      the options to fetch the actions with

    Returns:

See Also:


46
47
48
49
# File 'lib/tacokit/client/members.rb', line 46

def actions(username = "me", options = {})
  username, options = extract_member_args(username, options)
  paginated_get member_path(username, "actions"), options
end

- (Tacokit::Collection<Board>) boards(username = "me", options = {}) - (Tacokit::Resource) boards(options = {})

Overloads:

  • - (Tacokit::Collection<Board>) boards(username = "me", options = {})

    Retrieve a member's boards

    Examples:

    fetch the boards for the member named 'tacokit'

    Tacokit.boards("tacokit") #=> Tacokit::Collection<Board>

    Parameters:

    • username (String, Tacokit::Resource<Member>) (defaults to: "me")

      the username or member resource

    • options (Hash) (defaults to: {})

      the options to fetch the boards with

    Returns:

  • - (Tacokit::Resource) boards(options = {})

    Retrieve current member's boards

    Examples:

    fetch the current member's boards

    Tacokit.boards #=> Tacokit::Collection<Board>

    fetch the current member's open boards only

    Tacokit.boards(filter: "all") #=> Tacokit::Collection<Board>

    Parameters:

    • options (Hash) (defaults to: {})

      the options to fetch the boards with

    Returns:

See Also:


68
69
70
71
# File 'lib/tacokit/client/members.rb', line 68

def boards(username = "me", options = {})
  username, options = extract_member_args(username, options)
  get member_path(username, "boards"), options
end

- (Tacokit::Collection<Card>) cards(username = "me", options = {}) - (Tacokit::Collection<Card>) cards(options = {})

Overloads:

  • - (Tacokit::Collection<Card>) cards(username = "me", options = {})

    Retrieve a member's cards

    Examples:

    fetch the cards for the member named 'tacokit'

    Tacokit.cards("tacokit") #=> Tacokit::Collection<Card>

    Parameters:

    • username (String, Tacokit::Resource<Member>) (defaults to: "me")

      the username or member resource

    • options (Hash) (defaults to: {})

      the options to fetch the cards with

    Returns:

  • - (Tacokit::Collection<Card>) cards(options = {})

    Retrieve current member's cards

    Examples:

    fetch the current member's boards

    Tacokit.cards #=> Tacokit::Collection<Card>

    fetch the current member's closed cards only

    Tacokit.cards(filter: "closed") #=> Tacokit::Collection<Card>

    Parameters:

    • options (Hash) (defaults to: {})

      the options to fetch the cards with

    Returns:

See Also:


89
90
91
92
# File 'lib/tacokit/client/members.rb', line 89

def cards(username = "me", options = {})
  username, options = extract_member_args(username, options)
  get member_path(username, "cards"), options
end

- (Tacokit::Resource<Member>) member(username = "me", options = nil) - (Tacokit::Resource<Member>) member(options)

Overloads:

  • - (Tacokit::Resource<Member>) member(username = "me", options = nil)

    Retrieve a Trello member by username

    Examples:

    fetch the member named 'rossta'

    Tacokit.member("tacokit") #=> Tacokit::Resource<Member>

    Parameters:

    • username (String) (defaults to: "me")

      the member's username

    • options (Hash) (defaults to: nil)

      the options to fetch the member with

    Returns:

  • - (Tacokit::Resource<Member>) member(options)

    Retrieve the current member

    Examples:

    fetch the current member

    Tacokit.member #=> Tacokit::Resource<Member>

    fetch the current member with all boards

    Tacokit.member(boards: "all") #=> Tacokit::Resource<Member>

    configure a local client and fetch different current member

    client = Tacokit::Client.new app_key: "another-app-key"
    client.member #=> Tacokit::Resource<Member>

    Parameters:

    • options (Hash)

      the options to fetch the member with

    Returns:

See Also:


25
26
27
28
# File 'lib/tacokit/client/members.rb', line 25

def member(username = "me", options = nil)
  username, options = extract_member_args(username, options)
  get member_path(username), options
end

- (Tacokit::Collection<Notification>) notifications(username = "me", options = {}) - (Tacokit::Collection<Notification>) notifications(options = {})

Overloads:

  • - (Tacokit::Collection<Notification>) notifications(username = "me", options = {})

    Retrieve a member's notifications

    Examples:

    fetch the notifications for the member named 'tacokit'

    Tacokit.notifications("tacokit") #=> Tacokit::Collection<Notification>

    Parameters:

    • username (String, Tacokit::Resource<Member>) (defaults to: "me")

      the username or member resource

    • options (Hash) (defaults to: {})

      the options to fetch the notifications with

    Returns:

  • - (Tacokit::Collection<Notification>) notifications(options = {})

    Retrieve current member's notifications

    Examples:

    fetch the current member's boards

    Tacokit.notifications #=> Tacokit::Collection<Notification>

    fetch the current member's closed notifications only

    Tacokit.notifications(filter: "closed") #=> Tacokit::Collection<Notification>

    Parameters:

    • options (Hash) (defaults to: {})

      the options to fetch the notifications with

    Returns:

See Also:


110
111
112
113
# File 'lib/tacokit/client/members.rb', line 110

def notifications(username = "me", options = {})
  username, options = extract_member_args(username, options)
  paginated_get member_path(username, "notifications"), options
end

- (Tacokit::Collection<Organization>) organizations(username = "me", options = {}) - (Tacokit::Collection<Organization>) organizations(options = {})

Overloads:

  • - (Tacokit::Collection<Organization>) organizations(username = "me", options = {})

    Retrieve a member's organizations

    Examples:

    fetch the current member's boards

    Tacokit.organizations #=> Tacokit::Collection<Organization>

    fetch the current member's closed organizations only

    Tacokit.organizations(filter: "closed") #=> Tacokit::Collection<Organization>

    Parameters:

    • username (String, Tacokit::Resource<Member>) (defaults to: "me")

      the username or member resource

    • options (Hash) (defaults to: {})

      the options to fetch the organizations with

    Returns:

  • - (Tacokit::Collection<Organization>) organizations(options = {})

    Retrieve current member's organizations

    Examples:

    fetch the organizations for the member named 'tacokit'

    Tacokit.organizations("tacokit") #=> Tacokit::Collection<Organization>

    Parameters:

    • options (Hash) (defaults to: {})

      the options to fetch the organizations with

    Returns:

See Also:


131
132
133
134
# File 'lib/tacokit/client/members.rb', line 131

def organizations(username = "me", options = {})
  username, options = extract_member_args(username, options)
  get member_path(username, "organizations"), options
end

- (Tacokit::Collection<Token>) tokens(username = "me", options = {}) - (Tacokit::Collection<Token>) tokens(options = {})

Overloads:

  • - (Tacokit::Collection<Token>) tokens(username = "me", options = {})

    Retrieve a member's tokens

    Examples:

    fetch the current member's boards

    Tacokit.tokens #=> Tacokit::Collection<Token>

    fetch the current member's closed tokens only

    Tacokit.tokens(filter: "closed") #=> Tacokit::Collection<Token>

    Parameters:

    • username (String, Tacokit::Resource<Member>) (defaults to: "me")

      the username or member resource

    • options (Hash) (defaults to: {})

      the options to fetch the tokens with

    Returns:

  • - (Tacokit::Collection<Token>) tokens(options = {})

    Retrieve current member's tokens

    Examples:

    fetch the tokens for the member named 'tacokit'

    Tacokit.tokens("tacokit") #=> Tacokit::Collection<Token>

    Parameters:

    • options (Hash) (defaults to: {})

      the options to fetch the tokens with

    Returns:

See Also:


152
153
154
155
# File 'lib/tacokit/client/members.rb', line 152

def tokens(username = "me", options = {})
  username, options = extract_member_args(username, options)
  get member_path(username, "tokens"), options
end

- (Object) update_member(username = "me", options = {})

Update a member

Examples:

update current member's name

Tacokit.update_member(name: "Moonriver") #=> Tacokit::Resource<Member>

Parameters:

  • username (String, Tacokit::Resource<Member>) (defaults to: "me")

    the username or member resource

  • options (Hash) (defaults to: {})

    the attributes to update on the list

See Also:


163
164
165
166
# File 'lib/tacokit/client/members.rb', line 163

def update_member(username = "me", options = {})
  username, options = extract_member_args(username, options)
  put member_path(username), options
end