Module: Peanuts::Mappings::MultiMapping

Included in:
ElementValues, Elements
Defined in:
lib/peanuts/mappings.rb

Instance Method Summary collapse

Instance Method Details

#read_it(reader, acc) ⇒ Object



123
124
125
# File 'lib/peanuts/mappings.rb', line 123

def read_it(reader, acc)
  (acc || []) << read_value(reader)
end

#write_it(writer, values) ⇒ Object



127
128
129
# File 'lib/peanuts/mappings.rb', line 127

def write_it(writer, values)
  values.each {|value| write_node(writer) {|w| write_value(w, value) } } if values
end