Class: SigepWeb::SearchClient
- Inherits:
-
WebServiceInterfaceApi
- Object
- WebServiceInterfaceApi
- SigepWeb::SearchClient
- Defined in:
- lib/sigep_web/search_client.rb
Instance Method Summary collapse
-
#initialize(id_contract:, id_post_card:) ⇒ SearchClient
constructor
A new instance of SearchClient.
- #request ⇒ Object
Methods inherited from WebServiceInterfaceApi
Constructor Details
#initialize(id_contract:, id_post_card:) ⇒ SearchClient
Returns a new instance of SearchClient.
5 6 7 8 9 10 |
# File 'lib/sigep_web/search_client.rb', line 5 def initialize(id_contract:, id_post_card:) @id_contract = id_contract @id_post_card = id_post_card super() end |
Instance Method Details
#request ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/sigep_web/search_client.rb', line 12 def request authenticate = SigepWeb.configuration.authenticate response = process(:busca_cliente, idContrato: id_contract, idCartaoPostagem: id_post_card, usuario: authenticate.user, senha: authenticate.password ).to_hash[:busca_cliente_response][:return] { success: true, response: response } rescue Savon::SOAPFault => e { success: false, error: e. } end |