Class: SigepWeb::RequestPlpServices
- Inherits:
-
WebServiceInterfaceApi
- Object
- WebServiceInterfaceApi
- SigepWeb::RequestPlpServices
- Defined in:
- lib/sigep_web/request_plp_services.rb
Instance Method Summary collapse
-
#initialize(plp:, id_plp_client:, labels:) ⇒ RequestPlpServices
constructor
A new instance of RequestPlpServices.
- #request ⇒ Object
Methods inherited from WebServiceInterfaceApi
Constructor Details
#initialize(plp:, id_plp_client:, labels:) ⇒ RequestPlpServices
Returns a new instance of RequestPlpServices.
5 6 7 8 9 10 11 |
# File 'lib/sigep_web/request_plp_services.rb', line 5 def initialize(plp:, id_plp_client:, labels:) @plp = plp @id_plp_client = id_plp_client @labels = labels super() end |
Instance Method Details
#request ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/sigep_web/request_plp_services.rb', line 13 def request authenticate = SigepWeb.configuration.authenticate response = process( :fecha_plp_varios_servicos, xml: plp.to_xml, idPlpCliente: id_plp_client, cartaoPostagem: authenticate.card, listaEtiquetas: labels, usuario: authenticate.user, senha: authenticate.password ).to_hash[:fecha_plp_varios_servicos_response][:return].to_s {success: true, response: response} rescue Savon::SOAPFault => e {success: false, error: e.} end |