Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/do_as_rb19.rb

Overview

为Hash类添加key方法,1.8里面是 index 方法

Instance Method Summary collapse

Instance Method Details

#key(k) ⇒ Object


23
24
25
# File 'lib/do_as_rb19.rb', line 23

def key(k)
  self.index(k)
end