Welcome!  login or register

Your great ideas will be born here
language: Ruby (ruby 1.8.7)
date: 273 days 4 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
class Hash
  def method_missing(n)
    self[n.to_s]
  end
end
 
hash = {'apple'=>'orange'}
 
puts hash.apple
  • upload with new input

  • result: Success     time: 0s    memory: 4868 kB     returned value: 0       Would you like to manage your submissions?
    Sign up now and enjoy the full functionality of Ideone.

    orange