Class: SaxStream::Internal::MappingFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/sax_stream/internal/mapping_factory.rb

Class Method Summary collapse

Class Method Details

.build_mapping(name, options) ⇒ Object



8
9
10
11
12
# File 'lib/sax_stream/internal/mapping_factory.rb', line 8

def self.build_mapping(name, options)
  last_part = options[:to].split('/').last
  klass = (last_part =~ /^@/ ? Mappings::ElementAttribute : Mappings::ElementContent)
  klass.new(name, options)
end

.build_relation(name, options) ⇒ Object



14
15
16
# File 'lib/sax_stream/internal/mapping_factory.rb', line 14

def self.build_relation(name, options)
  Mappings::Child.new(name, options)
end