Module: Gorillib::StringFixup
- Extended by:
- Concern
- Defined in:
- lib/gorillib/model/fixup.rb
Instance Method Summary collapse
-
#receive!(hsh = {}) ⇒ Object
intercept to replace fixup-able hash keys with the proper field name in the receive hash.
Methods included from Concern
append_features, extended, included
Instance Method Details
#receive!(hsh = {}) ⇒ Object
intercept to replace fixup-able hash keys with the proper field name in the receive hash
9 10 11 12 13 14 15 |
# File 'lib/gorillib/model/fixup.rb', line 9 def receive!(hsh={}) self.class.fields.each do |field_name, field| next unless field.fixup? hsh[field_name] = hsh.delete(field.fixup) if hsh.has_key?(field.fixup) end super(hsh) end |