Sha256: a1f1127b77565d61b1ff43952845f6673a2292826ccda9c12b6aca13a2b18c33
Contents?: true
Size: 484 Bytes
Versions: 5
Compression:
Stored size: 484 Bytes
Contents
::Gorillib::Model::Field.class_eval do field :fixup, Symbol, doc: 'key to remap before receive', tester: true end module ::Gorillib::StringFixup extend Gorillib::Concern # intercept to replace fixup-able hash keys with the proper field name in the receive hash 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 end
Version data entries
5 entries across 5 versions & 1 rubygems