Class: Mooamba::Sedex
- Includes:
- SAXMachine
- Defined in:
- lib/mooamba/sedex.rb
Constant Summary collapse
- CODE =
40010- DEFAULT_PARAMS =
{ :nCdServico => CODE, :StrRetorno => "XML" }
Class Method Summary collapse
Class Method Details
.calculate(options = {}) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/mooamba/sedex.rb', line 20 def self.calculate(={}) raise InvalidOriginZipCode if invalid_cep?([:from]) raise InvalidDestinationZipCode if invalid_cep?([:to]) raise InvalidWeight if invalid_weight?([:weight]) response = response_for error?(response) ? (raise exception(response)) : response end |