Class: ThinkNear::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/think_near/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token, secret) ⇒ Connection

Returns a new instance of Connection.



8
9
10
11
12
# File 'lib/think_near/connection.rb', line 8

def initialize(token, secret)
  consumer = OAuth::Consumer.new(token, secret, :site => Client.api_host)
  @access_token = OAuth::AccessToken.new(consumer)
  debug = false
end

Instance Attribute Details

#debugObject

Returns the value of attribute debug.



6
7
8
# File 'lib/think_near/connection.rb', line 6

def debug
  @debug
end

Instance Method Details

#get(endpoint, data = nil) ⇒ Object



14
15
16
# File 'lib/think_near/connection.rb', line 14

def get(endpoint, data=nil)
  request :get, endpoint, data
end

#post(endpoint, data = nil) ⇒ Object



18
19
20
# File 'lib/think_near/connection.rb', line 18

def post(endpoint, data=nil)
  request :post, endpoint, data
end