# What hash method is called in this code?

**URL:** <https://www.ruby-forum.com/t/what-hash-method-is-called-in-this-code/149976>\
**Category:** Ruby\
**Created:** [October 1, 2008, 9:45pm UTC](https://www.ruby-forum.com/t/what-hash-method-is-called-in-this-code/149976 "2008-10-01T21:45:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lpc2148](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de053/32.png) [@lpc2148](https://www.ruby-forum.com/u/lpc2148)\
**Post date:** [October 1, 2008, 9:45pm UTC](https://www.ruby-forum.com/t/what-hash-method-is-called-in-this-code/149976/1 "2008-10-01T21:45:22Z")

</div>

When writing :

my\_hash = {“a” =\> “b”}

what method is called ? I tried patching initialize\_copy , and  
initialize , but that doesn’t seem to be it . What am I missing ?

---

<div class="post-metadata">

**Author:** ![lpc2148](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de053/32.png) [@lpc2148](https://www.ruby-forum.com/u/lpc2148)\
**Post date:** [October 1, 2008, 11:30pm UTC](https://www.ruby-forum.com/t/what-hash-method-is-called-in-this-code/149976/2 "2008-10-01T23:30:48Z")

</div>

On Oct 1, 2008, at 1:44 PM, Lex W. wrote:

> When writing :
> 
> my\_hash = {“a” =\> “b”}
> 
> what method is called ? I tried patching initialize\_copy , and  
> initialize , but that doesn’t seem to be it . What am I missing ?

c code. you cannot override the creation of literals from within ruby.

a @ [http://codeforpeople.com/](http://codeforpeople.com/)
