Class: FmTimbradoCfdi::FmRespuestaCancelacion
- Inherits:
-
Object
- Object
- FmTimbradoCfdi::FmRespuestaCancelacion
- Defined in:
- lib/fm_timbrado_cfdi/fm_respuesta_cancelacion.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
- #codigo ⇒ Object
-
#initialize(savon_response) ⇒ FmRespuestaCancelacion
constructor
A new instance of FmRespuestaCancelacion.
- #mensaje ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(savon_response) ⇒ FmRespuestaCancelacion
Returns a new instance of FmRespuestaCancelacion.
8 9 10 11 12 13 14 |
# File 'lib/fm_timbrado_cfdi/fm_respuesta_cancelacion.rb', line 8 def initialize(savon_response) @respuesta = savon_response unless valid? #@error = @respuesta.http_error.to_s if @respuesta.http_error? @error = @respuesta.to_s if @respuesta.soap_fault? end end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
7 8 9 |
# File 'lib/fm_timbrado_cfdi/fm_respuesta_cancelacion.rb', line 7 def error @error end |
Instance Method Details
#codigo ⇒ Object
16 17 18 |
# File 'lib/fm_timbrado_cfdi/fm_respuesta_cancelacion.rb', line 16 def codigo @error.match(/\((.*)\).*/)[0] if @error end |
#mensaje ⇒ Object
20 21 22 |
# File 'lib/fm_timbrado_cfdi/fm_respuesta_cancelacion.rb', line 20 def mensaje @error end |
#valid? ⇒ Boolean
24 25 26 |
# File 'lib/fm_timbrado_cfdi/fm_respuesta_cancelacion.rb', line 24 def valid? @respuesta.success? end |