Class: CommitLive::API

Inherits:
Object
  • Object
show all
Defined in:
lib/commit-live/api.rb

Constant Summary collapse

URL =
'http://api.greyatom.com'
API_ROOT =
'/api/v1'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAPI

Returns a new instance of API.



10
11
12
13
14
# File 'lib/commit-live/api.rb', line 10

def initialize()
  @conn = Faraday.new(url: URL) do |faraday|
    faraday.adapter Faraday.default_adapter
  end
end

Instance Attribute Details

#connObject (readonly)

Returns the value of attribute conn.



5
6
7
# File 'lib/commit-live/api.rb', line 5

def conn
  @conn
end

Instance Method Details

#get(url, options = {}) ⇒ Object



16
17
18
# File 'lib/commit-live/api.rb', line 16

def get(url, options = {})
  request :get, url, options
end

#post(url, options = {}) ⇒ Object



20
21
22
# File 'lib/commit-live/api.rb', line 20

def post(url, options = {})
  request :post, url, options
end