Class: Github::Client
- Inherits:
-
Object
- Object
- Github::Client
- Defined in:
- lib/github/client.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ access_token: nil, }
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #access_token ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #user ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Client
13 14 15 16 |
# File 'lib/github/client.rb', line 13 def initialize(={}) check_token end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
11 12 13 |
# File 'lib/github/client.rb', line 11 def @options end |
Instance Method Details
#access_token ⇒ Object
18 19 20 |
# File 'lib/github/client.rb', line 18 def access_token @options[:access_token] end |
#user ⇒ Object
22 23 24 |
# File 'lib/github/client.rb', line 22 def user RestClient.get("https://api.github.com/user", {params: {:access_token => self.access_token}}) end |