Class: GHClient::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/ghclient/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection = GHClient::Connection.new()) ⇒ Api

Returns a new instance of Api.



11
12
13
# File 'lib/ghclient/api.rb', line 11

def initialize connection = GHClient::Connection.new()
  @connection = connection
end

Instance Attribute Details

#connectionObject

Returns the value of attribute connection.



9
10
11
# File 'lib/ghclient/api.rb', line 9

def connection
  @connection
end

Instance Method Details

#get_languages_for_repository(repository) ⇒ Object



23
24
25
# File 'lib/ghclient/api.rb', line 23

def get_languages_for_repository(repository)
  @connection.get GHClient::Repository.languages_path(repository)
end

#get_repositories(user_name) ⇒ Object



19
20
21
# File 'lib/ghclient/api.rb', line 19

def get_repositories user_name
  @connection.get GHClient::User.repositories_path(user_name)
end

#get_user(user_name) ⇒ Object



15
16
17
# File 'lib/ghclient/api.rb', line 15

def get_user user_name
  @connection.get GHClient::User.path(user_name)
end