Class: AnythingHub::Github

Inherits:
Object
  • Object
show all
Defined in:
lib/anything-hub/github.rb

Instance Method Summary collapse

Constructor Details

#initialize(login, oauth_token) ⇒ Github

Returns a new instance of Github.



5
6
7
8
# File 'lib/anything-hub/github.rb', line 5

def initialize(, oauth_token)
  @login = 
  @oauth_token = oauth_token
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(action, *args) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/anything-hub/github.rb', line 14

def method_missing(action, *args)
  if client.respond_to?(action.to_s)
    client.send(action, *args)
  else
    super
  end
end

Instance Method Details

#clientObject



10
11
12
# File 'lib/anything-hub/github.rb', line 10

def client
  @client ||= Octokit::Client.new :login => @login, :oauth_token => @oauth_token, :auto_traversal => true
end