Class: Inforouter::Client
- Inherits:
-
Object
- Object
- Inforouter::Client
- Defined in:
- lib/inforouter/client.rb
Overview
A Client
communicates with the infoRouter service.
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#ticket ⇒ String
readonly
Returns the client ticket.
Instance Method Summary collapse
-
#call(method, message = {}) ⇒ Object
Make a safe SOAP call.
-
#initialize(options = {}) ⇒ Inforouter::Client
constructor
Initializes a new Client object.
- #operations ⇒ Array
- #request(method, message = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Inforouter::Client
Initializes a new Client object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/inforouter/client.rb', line 10 def initialize( = {}) = { log: false, logger: Logger.new($stdout), log_level: :info }.merge() @client = Savon.client( wsdl: Inforouter.configuration.wsdl, convert_request_keys_to: :camelcase, pretty_print_xml: true, ssl_verify_mode: :none, log: [:log], logger: [:logger], log_level: [:log_level] ) @ticket = nil end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
4 5 6 |
# File 'lib/inforouter/client.rb', line 4 def client @client end |
#ticket ⇒ String (readonly)
Returns the client ticket.
38 39 40 |
# File 'lib/inforouter/client.rb', line 38 def ticket @ticket end |
Instance Method Details
#call(method, message = {}) ⇒ Object
Make a safe SOAP call. Will raise a Inforouter::Errors::SOAPError on error.
48 49 50 51 52 |
# File 'lib/inforouter/client.rb', line 48 def call(method, = {}) safe do @client.call method, message: .merge(authentication_params) end end |
#operations ⇒ Array
31 32 33 |
# File 'lib/inforouter/client.rb', line 31 def operations @client.operations end |
#request(method, message = {}) ⇒ Object
54 55 56 |
# File 'lib/inforouter/client.rb', line 54 def request(method, = {}) call method, end |