Module Hashie::Extensions::MethodOverridingWriter
In: lib/hashie/extensions/method_access.rb

MethodOverridingWriter gives you key_name= shortcuts for writing to your hash. It allows methods to be overridden by key_name= shortcuts and aliases those methods with two leading underscores.

Keys are written as strings. Override convert_key if you would like to have symbols or something else.

Note that MethodOverridingWriter also overrides respond_to_missing? such that any method_name= will respond appropriately as true.

@example

  class MyHash < Hash
    include Hashie::Extensions::MethodOverridingWriter
  end

  h = MyHash.new
  h.awesome = 'sauce'
  h['awesome'] # => 'sauce'
  h.zip = 'a-dee-doo-dah'
  h.zip # => 'a-dee-doo-dah'
  h.__zip # => [[['awesome', 'sauce'], ['zip', 'a-dee-doo-dah']]]

Methods

Included Modules

RedefineMethod

Public Instance methods

Protected Instance methods

[Validate]