module TurboTest::ConstantTracer::HashLookupWithProxy::Methods

Public Class Methods

add_assign_method() click to toggle source
VALUE add_assign_method(VALUE self) {
  rb_define_method(turbo_test_hash_lookup_with_proxy_methods, "[]=", my_rb_hash_aset, 2);
  return Qtrue;
}
disable() click to toggle source
# File lib/turbo_test_constant_tracer/hash_lookup_with_proxy.rb, line 33
def disable
  class_eval do
    remove_method :[]=
  end
end
enable() click to toggle source
# File lib/turbo_test_constant_tracer/hash_lookup_with_proxy.rb, line 29
def enable
  add_assign_method
end

Public Instance Methods

[]=(p1, p2) click to toggle source
VALUE my_rb_hash_aset(VALUE hash, VALUE key, VALUE val) {
  key = rb_funcall(key, turbo_test_proxy_object_method, 0);
  return rb_hash_aset(hash, key, val);
}