Class: SimpleGeo::Connection
- Inherits:
-
Object
- Object
- SimpleGeo::Connection
- Defined in:
- lib/simple_geo/connection.rb
Instance Attribute Summary collapse
-
#debug ⇒ Object
Returns the value of attribute debug.
Instance Method Summary collapse
- #delete(endpoint, data = nil) ⇒ Object
- #get(endpoint, data = nil) ⇒ Object
-
#initialize(token, secret) ⇒ Connection
constructor
A new instance of Connection.
- #post(endpoint, data = nil) ⇒ Object
- #put(endpoint, data = nil) ⇒ Object
Constructor Details
#initialize(token, secret) ⇒ Connection
Returns a new instance of Connection.
6 7 8 9 10 |
# File 'lib/simple_geo/connection.rb', line 6 def initialize(token, secret) consumer = OAuth::Consumer.new(token, secret, :site => REALM) @access_token = OAuth::AccessToken.new(consumer) debug = false end |
Instance Attribute Details
#debug ⇒ Object
Returns the value of attribute debug.
4 5 6 |
# File 'lib/simple_geo/connection.rb', line 4 def debug @debug end |
Instance Method Details
#delete(endpoint, data = nil) ⇒ Object
16 17 18 |
# File 'lib/simple_geo/connection.rb', line 16 def delete(endpoint, data=nil) request :delete, endpoint, data end |
#get(endpoint, data = nil) ⇒ Object
12 13 14 |
# File 'lib/simple_geo/connection.rb', line 12 def get(endpoint, data=nil) request :get, endpoint, data end |
#post(endpoint, data = nil) ⇒ Object
20 21 22 |
# File 'lib/simple_geo/connection.rb', line 20 def post(endpoint, data=nil) request :post, endpoint, data end |
#put(endpoint, data = nil) ⇒ Object
24 25 26 |
# File 'lib/simple_geo/connection.rb', line 24 def put(endpoint, data=nil) request :put, endpoint, data end |