Module: Hashie::Extensions::Coercion

Defined in:
lib/hashie/extensions/coercion.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary (collapse)

Class Method Details

+ (Object) included(base)



4
5
6
7
8
9
10
# File 'lib/hashie/extensions/coercion.rb', line 4

def self.included(base)
  base.send :include, InstanceMethods
  base.extend ClassMethods # NOTE: we wanna make sure we first define set_value_with_coercion before extending

  base.send :alias_method, :set_value_without_coercion', :[]=
  base.send :alias_method, :[]=, :set_value_with_coercion'
end