README.rdoc in newbamboo-hash_mapper-0.0.5 vs README.rdoc in newbamboo-hash_mapper-0.0.6

- old
+ new

@@ -199,20 +199,20 @@ class EggMapper map from('/raw'), to('/fried') before_normalize do |input, output| - output[:time] = Time.now # the normalized hash will now be {:fried => 'blah', :time => <time object> } - output + input['raw'] ||= 'please' # this will give 'raw' a default value + input end after_denormalize do |input, output| output.to_a # the denormalized object will now be an array, not a hash!! end end -Important: note that you need to return the output each time. +Important: note that for before filters, you need to return the (modified) input, and for after filters, you need to return the output. Note also that 'output' is correct at the time of the filter, i.e. before_normalize yields 'output' as an empty hash, while after_normalize yields it as an already normalized hash. == REQUIREMENTS: \ No newline at end of file