Class: Tinybucket::Api::UserApi
- Includes:
- Helper::UserHelper
- Defined in:
- lib/tinybucket/api/user_api.rb
Overview
User Api client
Constant Summary
Constants included from Connection
Connection::DEFAULT_USER_AGENT
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#followers(options = {}) ⇒ Tinybucket::Model::Page
Send ‘GET the list of followers’ request.
-
#following(options = {}) ⇒ Tinybucket::Model::Page
Send ‘GET a list of accounts the user is following’ request.
-
#profile(options = {}) ⇒ Tinybucket::Model::Profile
Send ‘GET the user profile’ request.
-
#repos(options = {}) ⇒ Tinybucket::Model::Page
Send ‘GET the user’s repositories’ request.
Methods included from Connection
#caching?, #clear_cache, #connection
Instance Attribute Details
#username ⇒ String
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/tinybucket/api/user_api.rb', line 12 class UserApi < BaseApi include Tinybucket::Api::Helper::UserHelper attr_accessor :username # Send 'GET the user profile' request # # @param options [Hash] # @return [Tinybucket::Model::Profile] def profile( = {}) get_path( path_to_find, , get_parser(:object, Tinybucket::Model::Profile) ) end # Send 'GET the list of followers' request # # @param options [Hash] # @return [Tinybucket::Model::Page] def followers( = {}) get_path( path_to_followers, , get_parser(:collection, Tinybucket::Model::Profile) ) end # Send 'GET a list of accounts the user is following' request # # @param options [Hash] # @return [Tinybucket::Model::Page] def following( = {}) get_path( path_to_following, , get_parser(:collection, Tinybucket::Model::Profile) ) end # Send 'GET the user's repositories' request # # @param options [Hash] # @return [Tinybucket::Model::Page] def repos( = {}) get_path( path_to_repos, , get_parser(:collection, Tinybucket::Model::Repository) ) end end |
Instance Method Details
#followers(options = {}) ⇒ Tinybucket::Model::Page
Send ‘GET the list of followers’ request
33 34 35 36 37 38 39 |
# File 'lib/tinybucket/api/user_api.rb', line 33 def followers( = {}) get_path( path_to_followers, , get_parser(:collection, Tinybucket::Model::Profile) ) end |
#following(options = {}) ⇒ Tinybucket::Model::Page
Send ‘GET a list of accounts the user is following’ request
45 46 47 48 49 50 51 |
# File 'lib/tinybucket/api/user_api.rb', line 45 def following( = {}) get_path( path_to_following, , get_parser(:collection, Tinybucket::Model::Profile) ) end |
#profile(options = {}) ⇒ Tinybucket::Model::Profile
Send ‘GET the user profile’ request
21 22 23 24 25 26 27 |
# File 'lib/tinybucket/api/user_api.rb', line 21 def profile( = {}) get_path( path_to_find, , get_parser(:object, Tinybucket::Model::Profile) ) end |
#repos(options = {}) ⇒ Tinybucket::Model::Page
Send ‘GET the user’s repositories’ request
57 58 59 60 61 62 63 |
# File 'lib/tinybucket/api/user_api.rb', line 57 def repos( = {}) get_path( path_to_repos, , get_parser(:collection, Tinybucket::Model::Repository) ) end |