Class: Nfe::Helpers::XmlModel::Factory

Inherits:
Object
  • Object
show all
Defined in:
lib/nfe/helpers/xml_model/factory.rb

Class Method Summary collapse

Class Method Details

.create(name, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/nfe/helpers/xml_model/factory.rb', line 5

def self.create(name, options={})
  type = options[:type] || :text

  if type == :attribute
    AttributeNodeattribute.new(name, options)
  else
    XmlModel::const_get("Attribute#{type.capitalize}").new(name, options)
  end
end