Class: VertexClient::Connection
- Inherits:
-
Object
- Object
- VertexClient::Connection
- Defined in:
- lib/vertex_client/connection.rb
Constant Summary collapse
- VERTEX_NAMESPACE =
'urn:vertexinc:o-series:tps:7:0'.freeze
- ERROR_MESSAGE =
'The Vertex API returned an error or is unavailable'.freeze
Instance Method Summary collapse
- #client ⇒ Object
- #config ⇒ Object
-
#initialize(endpoint) ⇒ Connection
constructor
A new instance of Connection.
- #request(payload) ⇒ Object
Constructor Details
#initialize(endpoint) ⇒ Connection
Returns a new instance of Connection.
7 8 9 |
# File 'lib/vertex_client/connection.rb', line 7 def initialize(endpoint) @endpoint = endpoint end |
Instance Method Details
#client ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/vertex_client/connection.rb', line 20 def client @client ||= Savon.client do |globals| globals.endpoint clean_endpoint globals.namespace VERTEX_NAMESPACE globals.convert_request_keys_to :camelcase globals.env_namespace :soapenv globals.namespace_identifier :urn end end |
#config ⇒ Object
30 31 32 |
# File 'lib/vertex_client/connection.rb', line 30 def config @config ||= VertexClient.configuration end |
#request(payload) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/vertex_client/connection.rb', line 11 def request(payload) call_with_circuit_if_available do client.call( :vertex_envelope, message: shell_with_auth.merge(payload) ) end end |