Class: Handiv::Connection
- Inherits:
-
Object
- Object
- Handiv::Connection
- Defined in:
- lib/handiv/connection.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
-
#initialize(client) ⇒ Connection
constructor
A new instance of Connection.
- #send_data(path, data = {}) ⇒ Object
Constructor Details
#initialize(client) ⇒ Connection
Returns a new instance of Connection.
11 12 13 14 |
# File 'lib/handiv/connection.rb', line 11 def initialize(client) @client = client @connection = set_connection end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
9 10 11 |
# File 'lib/handiv/connection.rb', line 9 def client @client end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
9 10 11 |
# File 'lib/handiv/connection.rb', line 9 def connection @connection end |
Instance Method Details
#send_data(path, data = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/handiv/connection.rb', line 16 def send_data(path, data = {}) config.verify! response = post_data(path, data) response.status rescue => e client.logger.error "Failed to send a message (#{e.class} - #{e.})" 500 # Return status end |