Class: SigepWeb::RequestRange
- Inherits:
-
WebServiceReverseLogisticApi
- Object
- WebServiceReverseLogisticApi
- SigepWeb::RequestRange
- Defined in:
- lib/sigep_web/request_range.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RequestRange
constructor
A new instance of RequestRange.
- #request ⇒ Object
Methods inherited from WebServiceReverseLogisticApi
Constructor Details
#initialize(options = {}) ⇒ RequestRange
Returns a new instance of RequestRange.
3 4 5 6 7 8 |
# File 'lib/sigep_web/request_range.rb', line 3 def initialize( = {}) @type = [:type] @service = [:service] @quantity = [:quantity] super() end |
Instance Method Details
#request ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/sigep_web/request_range.rb', line 10 def request authenticate = SigepWeb.configuration.authenticate begin response = process(:solicitar_range, { usuario: authenticate.user, senha: authenticate.password, codAdministrativo: authenticate.administrative_code, contrato: authenticate.contract, tipo: @type, servico: @service, quantidade: @quantity }).to_hash[:solicitar_range_response][:return] { success: true, response: response } rescue Savon::SOAPFault => msg { success: false, error: msg } end end |