Class: BrNfe::Product::Reader::Nfe
- Inherits:
-
ActiveModelBase
- Object
- ActiveModelBase
- BrNfe::Product::Reader::Nfe
- Defined in:
- lib/br_nfe/product/reader/nfe.rb
Instance Attribute Summary
Attributes inherited from ActiveModelBase
Instance Method Summary collapse
-
#initialize(xml) ⇒ Nfe
constructor
A new instance of Nfe.
- #invoice ⇒ Object
- #xml_version ⇒ Object
Methods inherited from ActiveModelBase
#assign_attributes, #default_values
Constructor Details
#initialize(xml) ⇒ Nfe
Returns a new instance of Nfe.
5 6 7 8 9 10 11 12 |
# File 'lib/br_nfe/product/reader/nfe.rb', line 5 def initialize xml @xml = Nokogiri::XML xml @xml_version = find_xml_version @xml_nfe = @xml.css("NFe") @invoice = BrNfe::Product::NotaFiscal.new populate_invoice! @invoice end |
Instance Method Details
#invoice ⇒ Object
13 14 15 |
# File 'lib/br_nfe/product/reader/nfe.rb', line 13 def invoice @invoice end |
#xml_version ⇒ Object
17 18 19 |
# File 'lib/br_nfe/product/reader/nfe.rb', line 17 def xml_version @xml_version end |