Module: Nfe::Helpers::XmlModel::NfeModel::ClassMethods

Defined in:
lib/nfe/helpers/xml_model/nfe_model.rb

Instance Method Summary collapse

Instance Method Details

#attr_xml(xml_attr, options = {}) ⇒ Object



10
11
12
13
# File 'lib/nfe/helpers/xml_model/nfe_model.rb', line 10

def attr_xml(xml_attr, options={})
  register_xml_attr xml_attr, options
  register_attr_acessor xml_attribute(xml_attr)
end

#xml_attribute(attribute) ⇒ Object



23
24
25
# File 'lib/nfe/helpers/xml_model/nfe_model.rb', line 23

def xml_attribute(attribute)
  xml_attributes[attribute]
end

#xml_attributesObject



15
16
17
18
19
20
21
# File 'lib/nfe/helpers/xml_model/nfe_model.rb', line 15

def xml_attributes
  @xml_attributes ||= {}
  if self.superclass.methods.include?(:xml_attributes)
    @xml_attributes = self.superclass.xml_attributes.merge @xml_attributes
  end
  @xml_attributes
end