Class: SigepWeb::ServiceAvailability
- Inherits:
-
WebServiceInterfaceApi
- Object
- WebServiceInterfaceApi
- SigepWeb::ServiceAvailability
- Defined in:
- lib/sigep_web/service_availability.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ServiceAvailability
constructor
A new instance of ServiceAvailability.
- #request ⇒ Object
Methods inherited from WebServiceInterfaceApi
Constructor Details
#initialize(options = {}) ⇒ ServiceAvailability
Returns a new instance of ServiceAvailability.
3 4 5 6 7 8 |
# File 'lib/sigep_web/service_availability.rb', line 3 def initialize( = {}) @service_number = [:service_number] @source_zip = [:source_zip] @target_zip = [:target_zip] 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 |
# File 'lib/sigep_web/service_availability.rb', line 10 def request begin authenticate = SigepWeb.configuration.authenticate response = process(:verifica_disponibilidade_servico, { codAdministrativo: authenticate.administrative_code, numeroServico: @service_number, cepOrigem: @source_zip, cepDestino: @target_zip, usuario: authenticate.user, senha: authenticate.password }).to_hash[:verifica_disponibilidade_servico_response][:return] { success: true, response: response } rescue Savon::SOAPFault => msg { success: false, error: msg } end end |