Class: Savon::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/savon/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(globals = {}, &block) ⇒ Client

Returns a new instance of Client.



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/savon/client.rb', line 10

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

#globalsObject (readonly)

Returns the value of attribute globals.



24
25
26
# File 'lib/savon/client.rb', line 24

def globals
  @globals
end

Instance Method Details

#call(operation_name, locals = {}, &block) ⇒ Object



35
36
37
# File 'lib/savon/client.rb', line 35

def call(operation_name, locals = {}, &block)
  operation(operation_name).call(locals, &block)
end

#operation(operation_name) ⇒ Object



31
32
33
# File 'lib/savon/client.rb', line 31

def operation(operation_name)
  Operation.create(operation_name, @wsdl, @globals)
end

#operationsObject



26
27
28
29
# File 'lib/savon/client.rb', line 26

def operations
  raise_missing_wsdl_error! unless @wsdl.document?
  @wsdl.soap_actions
end

#service_nameObject



39
40
41
42
# File 'lib/savon/client.rb', line 39

def service_name
  raise_missing_wsdl_error! unless @wsdl.document?
  @wsdl.service_name
end