Class: Reponaut::GitHub::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username) ⇒ Client

Returns a new instance of Client.



15
16
17
# File 'lib/reponaut/github.rb', line 15

def initialize(username)
  @username = username
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/reponaut/github.rb', line 27

def method_missing(symbol, *args)
  if self.class.respond_to?(symbol)
    self.class.send(symbol, *args)
  else
    super
  end
end

Instance Attribute Details

#usernameObject (readonly)

Returns the value of attribute username.



13
14
15
# File 'lib/reponaut/github.rb', line 13

def username
  @username
end

Instance Method Details

#reposObject



19
20
21
# File 'lib/reponaut/github.rb', line 19

def repos
  repo_data.map { |e| Repository.new(self, e) }
end

#to_sObject



23
24
25
# File 'lib/reponaut/github.rb', line 23

def to_s
  username
end