Class: Octoplex::Client
- Inherits:
-
Object
- Object
- Octoplex::Client
- Includes:
- Root
- Defined in:
- lib/octoplex/client.rb,
lib/octoplex/client/base.rb,
lib/octoplex/client/root.rb,
lib/octoplex/client/user.rb,
lib/octoplex/client/repository.rb
Defined Under Namespace
Modules: Root Classes: Base, Repository, User
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #connection ⇒ Object
- #delete(path) ⇒ Object
-
#get(path) ⇒ Object
API Helper methods.
-
#initialize(options = nil) ⇒ Client
constructor
A new instance of Client.
- #post(path, body) ⇒ Object
- #put(path, body) ⇒ Object
-
#rate_limit ⇒ Object
The maximum number of API requests you can do this hour for this token.
-
#rate_limit_remaining ⇒ Object
The number of API requests you have left this hour.
Methods included from Root
Constructor Details
#initialize(options = nil) ⇒ Client
Returns a new instance of Client.
13 14 15 |
# File 'lib/octoplex/client.rb', line 13 def initialize( = nil) @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
11 12 13 |
# File 'lib/octoplex/client.rb', line 11 def @options end |
Instance Method Details
#connection ⇒ Object
17 18 19 |
# File 'lib/octoplex/client.rb', line 17 def connection @connection ||= Octoplex::Connection.new() end |
#delete(path) ⇒ Object
46 47 48 |
# File 'lib/octoplex/client.rb', line 46 def delete(path) connection.delete(path) end |
#get(path) ⇒ Object
API Helper methods
34 35 36 |
# File 'lib/octoplex/client.rb', line 34 def get(path) connection.get(path) end |
#post(path, body) ⇒ Object
38 39 40 |
# File 'lib/octoplex/client.rb', line 38 def post(path, body) connection.post(path, body) end |
#put(path, body) ⇒ Object
42 43 44 |
# File 'lib/octoplex/client.rb', line 42 def put(path, body) connection.put(path, body) end |
#rate_limit ⇒ Object
The maximum number of API requests you can do this hour for this token.
23 24 25 |
# File 'lib/octoplex/client.rb', line 23 def rate_limit connection.rate_limit end |
#rate_limit_remaining ⇒ Object
The number of API requests you have left this hour.
28 29 30 |
# File 'lib/octoplex/client.rb', line 28 def rate_limit_remaining connection.rate_limit_remaining end |