# O = Object.new; def o.to\_hash() {1=\>2} end; p Hash\[o\]

**URL:** <https://www.ruby-forum.com/t/o-object-new-def-o-to-hash-1-2-end-p-hash-o/136363>\
**Category:** Development\
**Created:** [May 1, 2008, 9:06am UTC](https://www.ruby-forum.com/t/o-object-new-def-o-to-hash-1-2-end-p-hash-o/136363 "2008-05-01T09:06:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [May 1, 2008, 9:06am UTC](https://www.ruby-forum.com/t/o-object-new-def-o-to-hash-1-2-end-p-hash-o/136363/1 "2008-05-01T09:06:10Z")

</div>

e$B0J2\<$N7k2L$,e(B {} e$B$K$J$k$N$OJQ$8$c$J$$$G$7$g$&$+!#e(B

% ./ruby -ve ‘o = Object.new; def o.to\_hash() {1=\>2} end; p Hash[o]’  
ruby 1.9.0 (2008-05-01 revision 16248) [i686-linux]  
{}
