Module: Shikimori::API::V1::Clubs
- Included in:
- Shikimori::API::V1
- Defined in:
- lib/shikimori/api/v1/clubs.rb
Overview
Methods for the Clubs API
Instance Method Summary collapse
-
#club(id, headers: nil, **query) ⇒ Hash
Get a club by id.
-
#club_animes(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s animes.
-
#club_characters(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s characters.
-
#club_clubs(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s clubs.
-
#club_collections(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s collections.
-
#club_images(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s images.
-
#club_mangas(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s mangas.
-
#club_members(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s members.
-
#club_ranobe(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s ranobe.
-
#clubs(headers: nil, **query) ⇒ Array<Hash>
Get list of clubs.
-
#join_club(id, headers: nil, **query) ⇒ Boolean
Join to club.
-
#leave_club(id, headers: nil, **query) ⇒ Boolean
Leave from club.
-
#update_club(id, club, headers: nil, **query) ⇒ Hash
Update Club.
Instance Method Details
#club(id, headers: nil, **query) ⇒ Hash
Get a club by id
50 51 52 |
# File 'lib/shikimori/api/v1/clubs.rb', line 50 def club(id, headers: nil, **query) rest.get base_url.join('clubs', id.to_s).url, headers: headers, query: query end |
#club_animes(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s animes
105 106 107 |
# File 'lib/shikimori/api/v1/clubs.rb', line 105 def club_animes(id, headers: nil, **query) rest.get base_url.join('clubs', id.to_s, 'animes').url, headers: headers, query: query end |
#club_characters(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s characters
177 178 179 |
# File 'lib/shikimori/api/v1/clubs.rb', line 177 def club_characters(id, headers: nil, **query) rest.get base_url.join('clubs', id.to_s, 'characters').url, headers: headers, query: query end |
#club_clubs(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s clubs
225 226 227 |
# File 'lib/shikimori/api/v1/clubs.rb', line 225 def club_clubs(id, headers: nil, **query) rest.get base_url.join('clubs', id.to_s, 'clubs').url, headers: headers, query: query end |
#club_collections(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s collections
201 202 203 |
# File 'lib/shikimori/api/v1/clubs.rb', line 201 def club_collections(id, headers: nil, **query) rest.get base_url.join('clubs', id.to_s, 'collections').url, headers: headers, query: query end |
#club_images(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s images
273 274 275 |
# File 'lib/shikimori/api/v1/clubs.rb', line 273 def club_images(id, headers: nil, **query) rest.get base_url.join('clubs', id.to_s, 'images').url, headers: headers, query: query end |
#club_mangas(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s mangas
129 130 131 |
# File 'lib/shikimori/api/v1/clubs.rb', line 129 def club_mangas(id, headers: nil, **query) rest.get base_url.join('clubs', id.to_s, 'mangas').url, headers: headers, query: query end |
#club_members(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s members
249 250 251 |
# File 'lib/shikimori/api/v1/clubs.rb', line 249 def club_members(id, headers: nil, **query) rest.get base_url.join('clubs', id.to_s, 'members').url, headers: headers, query: query end |
#club_ranobe(id, headers: nil, **query) ⇒ Array<Hash>
Get list of club’s ranobe
153 154 155 |
# File 'lib/shikimori/api/v1/clubs.rb', line 153 def club_ranobe(id, headers: nil, **query) rest.get base_url.join('clubs', id.to_s, 'ranobe').url, headers: headers, query: query end |
#clubs(headers: nil, **query) ⇒ Array<Hash>
Get list of clubs
28 29 30 |
# File 'lib/shikimori/api/v1/clubs.rb', line 28 def clubs(headers: nil, **query) rest.get base_url.join('clubs').url, headers: headers, query: query end |
#join_club(id, headers: nil, **query) ⇒ Boolean
Join to club. Requires ‘clubs` oauth scope
296 297 298 299 300 |
# File 'lib/shikimori/api/v1/clubs.rb', line 296 def join_club(id, headers: nil, **query) rest.post base_url.join('clubs', id.to_s, 'join').url, {}, headers: headers, query: query true end |
#leave_club(id, headers: nil, **query) ⇒ Boolean
Leave from club. Requires ‘clubs` oauth scope
321 322 323 324 325 |
# File 'lib/shikimori/api/v1/clubs.rb', line 321 def leave_club(id, headers: nil, **query) rest.post base_url.join('clubs', id.to_s, 'leave').url, {}, headers: headers, query: query true end |
#update_club(id, club, headers: nil, **query) ⇒ Hash
Update Club. Requires ‘clubs` oauth scope
81 82 83 |
# File 'lib/shikimori/api/v1/clubs.rb', line 81 def update_club(id, club, headers: nil, **query) rest.put base_url.join('clubs', id.to_s).url, { club: club }, headers: headers, query: query end |