Class: Savon::Client
- Inherits:
-
Object
- Object
- Savon::Client
- Defined in:
- lib/savon/client.rb
Instance Attribute Summary collapse
-
#globals ⇒ Object
readonly
Returns the value of attribute globals.
-
#wsdl ⇒ Object
readonly
Returns the value of attribute wsdl.
Instance Method Summary collapse
- #build_request(operation_name, locals = {}, &block) ⇒ Object
- #call(operation_name, locals = {}, &block) ⇒ Object
-
#initialize(globals = {}, &block) ⇒ Client
constructor
A new instance of Client.
- #operation(operation_name) ⇒ Object
- #operations ⇒ Object
- #service_name ⇒ Object
Constructor Details
#initialize(globals = {}, &block) ⇒ Client
Returns a new instance of Client.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/savon/client.rb', line 11 def initialize(globals = {}, &block) unless globals.kind_of? Hash raise_version1_initialize_error! globals end set_globals(globals, block) unless wsdl_or_endpoint_and_namespace_specified? raise_initialization_error! end build_wsdl_document end |
Instance Attribute Details
#globals ⇒ Object (readonly)
Returns the value of attribute globals.
25 26 27 |
# File 'lib/savon/client.rb', line 25 def globals @globals end |
#wsdl ⇒ Object (readonly)
Returns the value of attribute wsdl.
25 26 27 |
# File 'lib/savon/client.rb', line 25 def wsdl @wsdl end |
Instance Method Details
#build_request(operation_name, locals = {}, &block) ⇒ Object
45 46 47 |
# File 'lib/savon/client.rb', line 45 def build_request(operation_name, locals = {}, &block) operation(operation_name).request(locals, &block) end |
#call(operation_name, locals = {}, &block) ⇒ Object
36 37 38 |
# File 'lib/savon/client.rb', line 36 def call(operation_name, locals = {}, &block) operation(operation_name).call(locals, &block) end |
#operation(operation_name) ⇒ Object
32 33 34 |
# File 'lib/savon/client.rb', line 32 def operation(operation_name) Operation.create(operation_name, @wsdl, @globals) end |
#operations ⇒ Object
27 28 29 30 |
# File 'lib/savon/client.rb', line 27 def operations raise_missing_wsdl_error! unless @wsdl.document? @wsdl.soap_actions end |
#service_name ⇒ Object
40 41 42 43 |
# File 'lib/savon/client.rb', line 40 def service_name raise_missing_wsdl_error! unless @wsdl.document? @wsdl.service_name end |