Module: Tacokit::Client::Members

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

Overview

Methods for the Members API

Instance Method Summary collapse

Instance Method Details

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

Overloads:

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

    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:

  • #actions(options = nil) ⇒ Tacokit::Collection

    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

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

Overloads:

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

    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:

  • #boards(options = {}) ⇒ Tacokit::Resource

    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

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

Overloads:

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

    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:

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

    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

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

Overloads:

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

    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:

  • #member(options) ⇒ Tacokit::Resource<Member>

    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

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

Overloads:

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

    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:

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

    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

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

Overloads:

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

    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:

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

    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

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

Overloads:

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

    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:

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

    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

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

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