Module: Xapper

Defined in:
lib/xapper.rb

Defined Under Namespace

Classes: Mapper

Constant Summary collapse

@@mappings =
{}

Instance Method Summary collapse

Instance Method Details

#map(mapping, xml) ⇒ Object



14
15
16
# File 'lib/xapper.rb', line 14

def map(mapping, xml)
  @@mappings[mapping].map(xml)
end

#mappings(hash, namespaces = nil) ⇒ Object



7
8
9
10
11
12
# File 'lib/xapper.rb', line 7

def mappings(hash, namespaces = nil)
  mapper = Mapper.new
  mapper.mappings = hash[hash.keys[0]]
  mapper.namespaces = namespaces
  @@mappings[hash.keys[0]] = mapper
end