Class: Boletoman::Services::Soap::Request
- Inherits:
-
Object
- Object
- Boletoman::Services::Soap::Request
show all
- Defined in:
- lib/boletoman/services/soap/request.rb
Instance Method Summary
collapse
Instance Method Details
#basic_config ⇒ Object
37
38
39
|
# File 'lib/boletoman/services/soap/request.rb', line 37
def basic_config
{ wsdl: wsdl, log: ::Boletoman.configuration.verbose }
end
|
#call ⇒ Object
7
8
9
10
11
|
# File 'lib/boletoman/services/soap/request.rb', line 7
def call
response_class.new(response, self).tap do |response|
raise "Falha ao chamar operação #{operation}: #{response.body}" unless response.success?
end
end
|
#client ⇒ Object
21
22
23
|
# File 'lib/boletoman/services/soap/request.rb', line 21
def client
@client ||= Savon.client(config_options)
end
|
#config_options ⇒ Object
33
34
35
|
# File 'lib/boletoman/services/soap/request.rb', line 33
def config_options
basic_config.merge()
end
|
41
42
43
|
# File 'lib/boletoman/services/soap/request.rb', line 41
def
{}
end
|
#message ⇒ Object
29
30
31
|
# File 'lib/boletoman/services/soap/request.rb', line 29
def message
raise NotImplementedError
end
|
#operation ⇒ Object
25
26
27
|
# File 'lib/boletoman/services/soap/request.rb', line 25
def operation
raise NotImplementedError
end
|
#response ⇒ Object
17
18
19
|
# File 'lib/boletoman/services/soap/request.rb', line 17
def response
client.call(operation, message: message)
end
|
#response_class ⇒ Object
13
14
15
|
# File 'lib/boletoman/services/soap/request.rb', line 13
def response_class
"#{self.class}Response".constantize
end
|
#wsdl ⇒ Object
45
46
47
|
# File 'lib/boletoman/services/soap/request.rb', line 45
def wsdl
raise NotImplementedError
end
|