Skip to content

Instantly share code, notes, and snippets.

@ujihisa
Created May 28, 2009 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ujihisa/119556 to your computer and use it in GitHub Desktop.
Save ujihisa/119556 to your computer and use it in GitHub Desktop.
diff --git a/hash.c b/hash.c
index e80051e..9de7b8b 100644
--- a/hash.c
+++ b/hash.c
@@ -2624,8 +2624,8 @@ Init_Hash(void)
rb_define_method(rb_cHash,"to_hash", rb_hash_to_hash, 0);
rb_define_method(rb_cHash,"to_a", rb_hash_to_a, 0);
- rb_define_method(rb_cHash,"to_s", rb_hash_inspect, 0);
rb_define_method(rb_cHash,"inspect", rb_hash_inspect, 0);
+ rb_define_alias(rb_cHash, "to_s", "inspect");
rb_define_method(rb_cHash,"==", rb_hash_equal, 1);
rb_define_method(rb_cHash,"[]", rb_hash_aref, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment