Class: Cocoafish::Connection
- Inherits:
-
Object
- Object
- Cocoafish::Connection
- Defined in:
- lib/cocoafish/connection.rb
Instance Attribute Summary collapse
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#session_id ⇒ Object
Returns the value of attribute session_id.
Instance Method Summary collapse
- #delete(endpoint, data = nil) ⇒ Object
- #get(endpoint, data = nil) ⇒ Object
-
#initialize(token, secret, options = {}) ⇒ Connection
constructor
A new instance of Connection.
- #post(endpoint, data = nil) ⇒ Object
- #put(endpoint, data = nil) ⇒ Object
Constructor Details
#initialize(token, secret, options = {}) ⇒ Connection
Returns a new instance of Connection.
6 7 8 9 10 11 |
# File 'lib/cocoafish/connection.rb', line 6 def initialize(token, secret, = {}) @key = token @secret = secret @cookies = Hash.new @options = end |
Instance Attribute Details
#debug ⇒ Object
Returns the value of attribute debug.
4 5 6 |
# File 'lib/cocoafish/connection.rb', line 4 def debug @debug end |
#session_id ⇒ Object
Returns the value of attribute session_id.
4 5 6 |
# File 'lib/cocoafish/connection.rb', line 4 def session_id @session_id end |
Instance Method Details
#delete(endpoint, data = nil) ⇒ Object
17 18 19 |
# File 'lib/cocoafish/connection.rb', line 17 def delete(endpoint, data=nil) request :delete, endpoint, data end |
#get(endpoint, data = nil) ⇒ Object
13 14 15 |
# File 'lib/cocoafish/connection.rb', line 13 def get(endpoint, data=nil) request :get, endpoint, data end |
#post(endpoint, data = nil) ⇒ Object
21 22 23 |
# File 'lib/cocoafish/connection.rb', line 21 def post(endpoint, data=nil) request :post, endpoint, data end |
#put(endpoint, data = nil) ⇒ Object
25 26 27 |
# File 'lib/cocoafish/connection.rb', line 25 def put(endpoint, data=nil) request :put, endpoint, data end |