Class: SigepWeb::ZipQuery
- Inherits:
-
WebServiceInterfaceApi
- Object
- WebServiceInterfaceApi
- SigepWeb::ZipQuery
- Defined in:
- lib/sigep_web/zip_query.rb
Instance Method Summary collapse
-
#initialize(zip:) ⇒ ZipQuery
constructor
A new instance of ZipQuery.
- #request ⇒ Object
Methods inherited from WebServiceInterfaceApi
Constructor Details
#initialize(zip:) ⇒ ZipQuery
Returns a new instance of ZipQuery.
5 6 7 8 9 |
# File 'lib/sigep_web/zip_query.rb', line 5 def initialize(zip:) @zip = zip super() end |
Instance Method Details
#request ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/sigep_web/zip_query.rb', line 11 def request response = process( :consulta_cep, cep: zip ).to_hash[:consulta_cep_response][:return] {success: true, response: response} rescue Savon::SOAPFault => e {success: false, error: e.} end |