Exception: Correios::Sigep::RequestLabelNumbers
- Inherits:
-
CorreiosException
- Object
- StandardError
- CorreiosException
- Correios::Sigep::RequestLabelNumbers
- Defined in:
- lib/sigep/requests/request_label_numbers.rb
Constant Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ RequestLabelNumbers
constructor
A new instance of RequestLabelNumbers.
- #request ⇒ Object
Methods inherited from CorreiosException
#format_error_message, #generate_exception
Constructor Details
#initialize(data = {}) ⇒ RequestLabelNumbers
Returns a new instance of RequestLabelNumbers.
14 15 16 17 18 19 20 21 |
# File 'lib/sigep/requests/request_label_numbers.rb', line 14 def initialize(data = {}) @credentials = Correios.credentials @show_request = data[:show_request] @amount = data[:amount] @service_id = data[:service_id] super() end |
Instance Method Details
#request ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/sigep/requests/request_label_numbers.rb', line 23 def request puts xml if @show_request == true begin format_response(CLIENT.client.call(:solicita_etiquetas, soap_action: '', xml: xml).to_hash) rescue Savon::SOAPFault => error generate_exception(error) end end |