Class: RestfulPress::Connection
- Inherits:
-
Object
- Object
- RestfulPress::Connection
- Defined in:
- lib/restful_press/connection.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#default_options ⇒ Object
readonly
Returns the value of attribute default_options.
Instance Method Summary collapse
- #delete(endpoint, data = nil) ⇒ Object
- #get(endpoint, data = nil) ⇒ Object
-
#initialize(api_key) ⇒ Connection
constructor
A new instance of Connection.
- #post(endpoint, data = nil) ⇒ Object
- #put(endpoint, data = nil) ⇒ Object
Constructor Details
#initialize(api_key) ⇒ Connection
Returns a new instance of Connection.
8 9 10 11 12 |
# File 'lib/restful_press/connection.rb', line 8 def initialize(api_key) @api_key = api_key @default_options = { :api_key => @api_key } @debug = false end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/restful_press/connection.rb', line 6 def api_key @api_key end |
#debug ⇒ Object
Returns the value of attribute debug.
5 6 7 |
# File 'lib/restful_press/connection.rb', line 5 def debug @debug end |
#default_options ⇒ Object (readonly)
Returns the value of attribute default_options.
6 7 8 |
# File 'lib/restful_press/connection.rb', line 6 def @default_options end |
Instance Method Details
#delete(endpoint, data = nil) ⇒ Object
18 19 20 |
# File 'lib/restful_press/connection.rb', line 18 def delete(endpoint, data=nil) request :delete, endpoint, data end |
#get(endpoint, data = nil) ⇒ Object
14 15 16 |
# File 'lib/restful_press/connection.rb', line 14 def get(endpoint, data=nil) request :get, endpoint, data end |
#post(endpoint, data = nil) ⇒ Object
22 23 24 |
# File 'lib/restful_press/connection.rb', line 22 def post(endpoint, data=nil) request :post, endpoint, data end |
#put(endpoint, data = nil) ⇒ Object
26 27 28 |
# File 'lib/restful_press/connection.rb', line 26 def put(endpoint, data=nil) request :put, endpoint, data end |