Class: FmTimbradoCfdi::FmRespuesta
- Inherits:
-
Object
- Object
- FmTimbradoCfdi::FmRespuesta
- Defined in:
- lib/fm_adapter/fm_respuesta.rb
Instance Attribute Summary collapse
-
#cbb ⇒ Object
readonly
Returns the value of attribute cbb.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#no_csd_emisor ⇒ Object
readonly
Returns the value of attribute no_csd_emisor.
-
#pdf ⇒ Object
readonly
Returns the value of attribute pdf.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#timbre ⇒ Object
readonly
Returns the value of attribute timbre.
-
#xml ⇒ Object
readonly
Returns the value of attribute xml.
Instance Method Summary collapse
- #cbb? ⇒ Boolean (also: #cbb_present?)
-
#initialize(response) ⇒ FmRespuesta
constructor
A new instance of FmRespuesta.
- #no_csd_emisor? ⇒ Boolean (also: #no_csd_emisor_present?)
- #parse_savon(savon_response) ⇒ Object
- #pdf? ⇒ Boolean (also: #pdf_present?)
- #timbre? ⇒ Boolean (also: #timbre_present?)
- #valid? ⇒ Boolean
- #xml? ⇒ Boolean (also: #xml_present?)
Constructor Details
#initialize(response) ⇒ FmRespuesta
Returns a new instance of FmRespuesta.
9 10 11 12 13 14 15 16 17 |
# File 'lib/fm_adapter/fm_respuesta.rb', line 9 def initialize(response) @errors = [] if response.is_a? String @raw = response procesar_respuesta(response) else parse_savon(response) end end |
Instance Attribute Details
#cbb ⇒ Object (readonly)
Returns the value of attribute cbb.
7 8 9 |
# File 'lib/fm_adapter/fm_respuesta.rb', line 7 def cbb @cbb end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
7 8 9 |
# File 'lib/fm_adapter/fm_respuesta.rb', line 7 def errors @errors end |
#no_csd_emisor ⇒ Object (readonly)
Returns the value of attribute no_csd_emisor.
7 8 9 |
# File 'lib/fm_adapter/fm_respuesta.rb', line 7 def no_csd_emisor @no_csd_emisor end |
#pdf ⇒ Object (readonly)
Returns the value of attribute pdf.
7 8 9 |
# File 'lib/fm_adapter/fm_respuesta.rb', line 7 def pdf @pdf end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
7 8 9 |
# File 'lib/fm_adapter/fm_respuesta.rb', line 7 def raw @raw end |
#timbre ⇒ Object (readonly)
Returns the value of attribute timbre.
7 8 9 |
# File 'lib/fm_adapter/fm_respuesta.rb', line 7 def timbre @timbre end |
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
7 8 9 |
# File 'lib/fm_adapter/fm_respuesta.rb', line 7 def xml @xml end |
Instance Method Details
#cbb? ⇒ Boolean Also known as: cbb_present?
39 40 41 |
# File 'lib/fm_adapter/fm_respuesta.rb', line 39 def cbb? !!@cbb end |
#no_csd_emisor? ⇒ Boolean Also known as: no_csd_emisor_present?
51 52 53 |
# File 'lib/fm_adapter/fm_respuesta.rb', line 51 def no_csd_emisor? !!@no_csd_emisor end |
#parse_savon(savon_response) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fm_adapter/fm_respuesta.rb', line 19 def parse_savon(savon_response) if savon_response.success? @raw = savon_response.to_xml procesar_respuesta(savon_response.to_xml) else @errors << savon_response.soap_fault.to_s if savon_response.soap_fault? @doc = @xml = @no_csd_emisor = @timbre = @pdf = @cbb = nil end rescue Exception => e @errors << "No se ha podido realizar el parseo de la respuesta. #{e.}" end |
#pdf? ⇒ Boolean Also known as: pdf_present?
43 44 45 |
# File 'lib/fm_adapter/fm_respuesta.rb', line 43 def pdf? !!@pdf end |
#timbre? ⇒ Boolean Also known as: timbre_present?
47 48 49 |
# File 'lib/fm_adapter/fm_respuesta.rb', line 47 def timbre? !!@timbre end |
#valid? ⇒ Boolean
31 32 33 |
# File 'lib/fm_adapter/fm_respuesta.rb', line 31 def valid? @errors.empty? end |
#xml? ⇒ Boolean Also known as: xml_present?
35 36 37 |
# File 'lib/fm_adapter/fm_respuesta.rb', line 35 def xml? !!@xml end |