diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-10-18 10:18:43 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-10-18 10:18:43 +0900 |
| commit | ce916b99b81fedf6561f8d3303320b31aa27d51c (patch) | |
| tree | e6b1a7f56e951470ca74acaf84664ced0f5dd713 | |
| parent | b5dfbce76702e8ef6891d8a995de405a14b4ee03 (diff) | |
| download | mruby-ce916b99b81fedf6561f8d3303320b31aa27d51c.tar.gz mruby-ce916b99b81fedf6561f8d3303320b31aa27d51c.zip | |
Add `Hash#to_proc`; CRuby2.3
| -rw-r--r-- | mrbgems/mruby-hash-ext/mrblib/hash.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mrbgems/mruby-hash-ext/mrblib/hash.rb b/mrbgems/mruby-hash-ext/mrblib/hash.rb index 7bf06a0ad..d1a709325 100644 --- a/mrbgems/mruby-hash-ext/mrblib/hash.rb +++ b/mrbgems/mruby-hash-ext/mrblib/hash.rb @@ -475,6 +475,10 @@ class Hash self end + def to_proc + ->x{self[x]} + end + ## # call-seq: # hsh.fetch_values(key, ...) -> array |
