Class: Tinybucket::Api::TeamApi

Inherits:
BaseApi
  • Object
show all
Includes:
Helper::TeamHelper
Defined in:
lib/tinybucket/api/team_api.rb

Overview

Team Api client

See Also:

Constant Summary

Constants included from Connection

Connection::DEFAULT_USER_AGENT

Instance Method Summary collapse

Methods included from Connection

#caching?, #clear_cache, #connection

Instance Method Details

#find(name, options = {}) ⇒ Tinybucket::Model::Team

Send 'GET the team profile' request

Parameters:

  • name (String)

    The team's name

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

Returns:


30
31
32
33
34
35
36
# File 'lib/tinybucket/api/team_api.rb', line 30

def find(name, options = {})
  get_path(
    path_to_find(name),
    options,
    get_parser(:object, Tinybucket::Model::Team)
  )
end

#followers(name, options = {}) ⇒ Tinybucket::Model::Page

Send 'GET the list of followers' request

Parameters:

  • name (String)

    The team's name

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

Returns:


56
57
58
59
60
61
62
# File 'lib/tinybucket/api/team_api.rb', line 56

def followers(name, options = {})
  get_path(
    path_to_followers(name),
    options,
    get_parser(:collection, Tinybucket::Model::Team)
  )
end

#following(name, options = {}) ⇒ Tinybucket::Model::Page

Send 'GET a lisf of accounts the team is following' request

Parameters:

  • name (String)

    The team's name

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

Returns:


69
70
71
72
73
74
75
# File 'lib/tinybucket/api/team_api.rb', line 69

def following(name, options = {})
  get_path(
    path_to_following(name),
    options,
    get_parser(:collection, Tinybucket::Model::Team)
  )
end

#list(role_name, options = {}) ⇒ Tinybucket::Model::Page

Send 'GET teams' request

Parameters:

  • role_name (String)

    role name

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

Returns:


17
18
19
20
21
22
23
# File 'lib/tinybucket/api/team_api.rb', line 17

def list(role_name, options = {})
  get_path(
    path_to_list,
    { role: role_name }.merge(options),
    get_parser(:collection, Tinybucket::Model::Team)
  )
end

#members(name, options = {}) ⇒ Tinybucket::Model::Page

Send 'GET the team members' request

Parameters:

  • name (String)

    The team's name

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

Returns:


43
44
45
46
47
48
49
# File 'lib/tinybucket/api/team_api.rb', line 43

def members(name, options = {})
  get_path(
    path_to_members(name),
    options,
    get_parser(:collection, Tinybucket::Model::Team)
  )
end

#repos(name, options = {}) ⇒ Tinybucket::Model::Page

Send 'GET the team's repositories' request

Parameters:

  • name (String)

    The team's name

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

Returns:


82
83
84
85
86
87
88
# File 'lib/tinybucket/api/team_api.rb', line 82

def repos(name, options = {})
  get_path(
    path_to_repos(name),
    options,
    get_parser(:collection, Tinybucket::Model::Repository)
  )
end