Class: GitHub::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/github/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(=nil, access_token=nil)
  @login = 
  @access_token = access_token
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



7
8
9
# File 'lib/github/client.rb', line 7

def access_token
  @access_token
end

#loginObject (readonly)

Returns the value of attribute login.



7
8
9
# File 'lib/github/client.rb', line 7

def 
  @login
end

Instance Method Details

#emailsObject

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

#usersObject



18
19
20
# File 'lib/github/client.rb', line 18

def users
  get "/users"
end