Class: CircuitApi::Utils::Connection
- Inherits:
-
Object
- Object
- CircuitApi::Utils::Connection
- Defined in:
- lib/circuit_api/utils/connection.rb
Constant Summary collapse
- RESPONSE_SUCCESS_CODES =
[200, 201, 202, 204].freeze
Instance Attribute Summary collapse
-
#action_url ⇒ Object
readonly
Returns the value of attribute action_url.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #delete ⇒ Object
- #get ⇒ Object
-
#initialize(client, action_url, body = nil) ⇒ Connection
constructor
A new instance of Connection.
- #post ⇒ Object
- #put ⇒ Object
Constructor Details
#initialize(client, action_url, body = nil) ⇒ Connection
Returns a new instance of Connection.
8 9 10 11 12 |
# File 'lib/circuit_api/utils/connection.rb', line 8 def initialize(client, action_url, body = nil) @client = client @action_url = action_url @body = body end |
Instance Attribute Details
#action_url ⇒ Object (readonly)
Returns the value of attribute action_url.
6 7 8 |
# File 'lib/circuit_api/utils/connection.rb', line 6 def action_url @action_url end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/circuit_api/utils/connection.rb', line 6 def body @body end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
6 7 8 |
# File 'lib/circuit_api/utils/connection.rb', line 6 def client @client end |
Instance Method Details
#delete ⇒ Object
26 27 28 |
# File 'lib/circuit_api/utils/connection.rb', line 26 def delete perform_query(:delete) end |
#get ⇒ Object
14 15 16 |
# File 'lib/circuit_api/utils/connection.rb', line 14 def get perform_query(:get) end |
#post ⇒ Object
18 19 20 |
# File 'lib/circuit_api/utils/connection.rb', line 18 def post perform_query(:post) end |
#put ⇒ Object
22 23 24 |
# File 'lib/circuit_api/utils/connection.rb', line 22 def put perform_query(:put) end |