Exception: Correios::Sigep::SearchZipCode
- Inherits:
-
CorreiosException
- Object
- StandardError
- CorreiosException
- Correios::Sigep::SearchZipCode
- Defined in:
- lib/sigep/requests/search_zip_code.rb
Constant Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ SearchZipCode
constructor
A new instance of SearchZipCode.
- #request ⇒ Object
Methods inherited from CorreiosException
#format_error_message, #generate_exception
Constructor Details
#initialize(data = {}) ⇒ SearchZipCode
Returns a new instance of SearchZipCode.
14 15 16 17 18 |
# File 'lib/sigep/requests/search_zip_code.rb', line 14 def initialize(data = {}) @show_request = data[:show_request] @zip_code = data[:zip_code] super() end |
Instance Method Details
#request ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/sigep/requests/search_zip_code.rb', line 20 def request puts xml if @show_request == true begin format_response(CLIENT.client.call(:consulta_cep, soap_action: '', xml: xml).to_hash) rescue Savon::SOAPFault => error generate_exception(error) end end |