Class: SigepWeb::RequestPlpServices
- Inherits:
-
WebServiceInterfaceApi
- Object
- WebServiceInterfaceApi
- SigepWeb::RequestPlpServices
- Defined in:
- lib/sigep_web/request_plp_services.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RequestPlpServices
constructor
A new instance of RequestPlpServices.
- #request ⇒ Object
Methods inherited from WebServiceInterfaceApi
Constructor Details
#initialize(options = {}) ⇒ RequestPlpServices
Returns a new instance of RequestPlpServices.
3 4 5 6 7 8 9 |
# File 'lib/sigep_web/request_plp_services.rb', line 3 def initialize( = {}) @plp = [:plp] @id_plp_client = [:id_plp_client] #@post_card = options[:post_card] @labels = [:labels] super() end |
Instance Method Details
#request ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/sigep_web/request_plp_services.rb', line 11 def request authenticate = SigepWeb.configuration.authenticate begin 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 => msg { success: false, error: msg } end end |