Class: Fasterer::Github::ApiWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/fasterer/github/api_wrapper.rb

Constant Summary collapse

BASE_URI =
'https://api.github.com'

Instance Method Summary collapse

Constructor Details

#initialize(owner, repo) ⇒ ApiWrapper

Returns a new instance of ApiWrapper.



8
9
10
11
12
13
14
# File 'lib/fasterer/github/api_wrapper.rb', line 8

def initialize(owner, repo)
  @owner = owner
  @repo = repo
  @access_token = Fasterer::Github.configuration.access_token.to_s
  @client_id = Fasterer::Github.configuration.client_id.to_s
  @client_secret = Fasterer::Github.configuration.client_secret.to_s
end

Instance Method Details

#contents(path) ⇒ Object



16
17
18
# File 'lib/fasterer/github/api_wrapper.rb', line 16

def contents(path)
  HTTParty.get(build_uri(path), query: authorization_params)
end