Class: Nfe::Models::Information::InfAdic
- Inherits:
-
Object
- Object
- Nfe::Models::Information::InfAdic
- Includes:
- ActiveModel::Model, Helpers::XmlModel::NfeModel
- Defined in:
- lib/nfe/models/information/infAdic.rb
Instance Method Summary collapse
-
#initialize ⇒ InfAdic
constructor
A new instance of InfAdic.
- #to_xml ⇒ Object
Methods included from Helpers::XmlModel::NfeModel
#add_elements, #check_present, included, #parse!, #parse_elements, #present?, #validate_optional_attributes, #validate_required_attributes
Constructor Details
#initialize ⇒ InfAdic
Returns a new instance of InfAdic.
25 26 27 28 29 |
# File 'lib/nfe/models/information/infAdic.rb', line 25 def initialize @obsFisco = [] @obsCont = [] @procRef = [] end |
Instance Method Details
#to_xml ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/nfe/models/information/infAdic.rb', line 31 def to_xml xml = Builder::XmlMarkup.new add_elements xml, :infAdFisco, :infCpl @obsCont.each do |obsCont| xml.obsCont(xCampo: obsCont.xCampo) { |node| node << obsCont.to_xml } end @obsFisco.each do |obsFisco| xml.obsFisco(xCampo: obsFisco.xCampo) { |node| node << obsFisco.to_xml } end add_elements xml, :procRef xml.target! end |