Class: GitHub::Client
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#login ⇒ Object
readonly
Returns the value of attribute login.
Instance Method Summary collapse
-
#emails ⇒ Object
Get emails for authenticated user.
- #events(username) ⇒ Object
- #followers(username) ⇒ Object
- #following(username) ⇒ Object
-
#initialize(login = nil, access_token = nil) ⇒ Client
constructor
A new instance of Client.
- #repos(username) ⇒ Object
- #user(username) ⇒ Object
- #users ⇒ Object
Constructor Details
#initialize(login = nil, access_token = nil) ⇒ Client
Returns a new instance of Client.
9 10 11 12 |
# File 'lib/github/client.rb', line 9 def initialize(login=nil, access_token=nil) @login = login @access_token = access_token end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
7 8 9 |
# File 'lib/github/client.rb', line 7 def access_token @access_token end |
#login ⇒ Object (readonly)
Returns the value of attribute login.
7 8 9 |
# File 'lib/github/client.rb', line 7 def login @login end |
Instance Method Details
#emails ⇒ Object
Get emails for authenticated user
23 24 25 |
# File 'lib/github/client.rb', line 23 def emails get "/user/emails", auth_params end |
#events(username) ⇒ Object
35 36 37 |
# File 'lib/github/client.rb', line 35 def events(username) get "/users/#{username}/events" end |
#followers(username) ⇒ Object
27 28 29 |
# File 'lib/github/client.rb', line 27 def followers(username) get "/users/#{username}/followers" end |
#following(username) ⇒ Object
31 32 33 |
# File 'lib/github/client.rb', line 31 def following(username) get "/users/#{username}/following" end |
#repos(username) ⇒ Object
39 40 41 |
# File 'lib/github/client.rb', line 39 def repos(username) get "/users/#{username}/repos" end |
#user(username) ⇒ Object
14 15 16 |
# File 'lib/github/client.rb', line 14 def user(username) get "/users/#{username}" end |
#users ⇒ Object
18 19 20 |
# File 'lib/github/client.rb', line 18 def users get "/users" end |