Class: BuhoCfdi::XmlProcessor
- Inherits:
-
Object
- Object
- BuhoCfdi::XmlProcessor
- Defined in:
- lib/buho_cfdi.rb
Instance Attribute Summary collapse
-
#cfdi ⇒ Object
Returns the value of attribute cfdi.
-
#receipt ⇒ Object
Returns the value of attribute receipt.
-
#strategy ⇒ Object
Returns the value of attribute strategy.
Instance Method Summary collapse
-
#initialize(params) ⇒ XmlProcessor
constructor
A new instance of XmlProcessor.
- #process_xml ⇒ Object
Constructor Details
#initialize(params) ⇒ XmlProcessor
Returns a new instance of XmlProcessor.
31 32 33 34 35 |
# File 'lib/buho_cfdi.rb', line 31 def initialize(params) @strategy = XML_BUILDING_STRATEGY @receipt = BuhoCfdi::ParamsBuilder.new(params).receipt end |
Instance Attribute Details
#cfdi ⇒ Object
Returns the value of attribute cfdi.
29 30 31 |
# File 'lib/buho_cfdi.rb', line 29 def cfdi @cfdi end |
#receipt ⇒ Object
Returns the value of attribute receipt.
29 30 31 |
# File 'lib/buho_cfdi.rb', line 29 def receipt @receipt end |
#strategy ⇒ Object
Returns the value of attribute strategy.
29 30 31 |
# File 'lib/buho_cfdi.rb', line 29 def strategy @strategy end |
Instance Method Details
#process_xml ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/buho_cfdi.rb', line 37 def process_xml @cfdi = strategy.call(receipt) # file = File.new('xml_example.xml', 'w+') # file.write(cfdi.to_xml) # file.close cfdi end |