Module | Hashie::Extensions::MethodWriter |
In: |
lib/hashie/extensions/method_access.rb
|
MethodWriter gives you key_name= shortcuts for writing to your hash. Keys are written as strings, override convert_key if you would like to have symbols or something else.
Note that MethodWriter also overrides respond_to such that any method_name= will respond appropriately as true.
@example
class MyHash < Hash include Hashie::Extensions::MethodWriter end h = MyHash.new h.awesome = 'sauce' h['awesome'] # => 'sauce'