Class: AutotaskApi::Client
- Inherits:
-
Object
- Object
- AutotaskApi::Client
- Defined in:
- lib/autotask_api/client.rb
Constant Summary collapse
- NAMESPACE =
'http://autotask.net/ATWS/v1_5/'
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #call(operation, message = {}) ⇒ Object
-
#initialize {|@config| ... } ⇒ Client
constructor
A new instance of Client.
- #savon_client ⇒ Object
Constructor Details
#initialize {|@config| ... } ⇒ Client
Returns a new instance of Client.
17 18 19 20 |
# File 'lib/autotask_api/client.rb', line 17 def initialize @config = AutotaskApi.config yield @config if block_given? end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
15 16 17 |
# File 'lib/autotask_api/client.rb', line 15 def config @config end |
Instance Method Details
#call(operation, message = {}) ⇒ Object
32 33 34 |
# File 'lib/autotask_api/client.rb', line 32 def call(operation, = {}) savon_client.call(operation, message: , attributes: { xmlns: NAMESPACE }) end |
#savon_client ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/autotask_api/client.rb', line 22 def savon_client @savon_client ||= Savon.client( wsdl: config.wsdl, logger: Rails.logger, log_level: :debug, log: config.debug, basic_auth: [config.username, config.password] ) end |