Class: Octoplex::Client

Inherits:
Object
  • Object
show all
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, Users

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Root

#orgs, #repos, #user, #users

Constructor Details

#initialize(options = nil) ⇒ Client

Returns a new instance of Client.



13
14
15
# File 'lib/octoplex/client.rb', line 13

def initialize(options = nil)
  @options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



11
12
13
# File 'lib/octoplex/client.rb', line 11

def options
  @options
end

Instance Method Details

#connectionObject



17
18
19
# File 'lib/octoplex/client.rb', line 17

def connection
  @connection ||= Octoplex::Connection.new(options)
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_limitObject

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_remainingObject

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