Class: ThinkNear::Connection
- Inherits:
-
Object
- Object
- ThinkNear::Connection
- Defined in:
- lib/think_near/connection.rb
Instance Attribute Summary collapse
-
#debug ⇒ Object
Returns the value of attribute debug.
Instance Method Summary collapse
- #get(endpoint, data = nil) ⇒ Object
-
#initialize(token, secret) ⇒ Connection
constructor
A new instance of Connection.
- #post(endpoint, data = nil) ⇒ Object
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
#debug ⇒ Object
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 |