diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-06-04 18:57:31 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-06-04 18:57:31 +0900 |
| commit | 172060877a80d5f1c5bd725dafd041c7180e9a28 (patch) | |
| tree | 510311b176210a88a1ab7dc7a59b785e556af38a /mrbgems/mruby-hash-ext/mrblib | |
| parent | 8a9e2066c3124f6bcd65d724bd519265a7d6ebe9 (diff) | |
| download | mruby-172060877a80d5f1c5bd725dafd041c7180e9a28.tar.gz mruby-172060877a80d5f1c5bd725dafd041c7180e9a28.zip | |
add Hash#to_h; ref #2348
Diffstat (limited to 'mrbgems/mruby-hash-ext/mrblib')
| -rw-r--r-- | mrbgems/mruby-hash-ext/mrblib/hash.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mrbgems/mruby-hash-ext/mrblib/hash.rb b/mrbgems/mruby-hash-ext/mrblib/hash.rb index 504848a74..9da08dc3a 100644 --- a/mrbgems/mruby-hash-ext/mrblib/hash.rb +++ b/mrbgems/mruby-hash-ext/mrblib/hash.rb @@ -182,4 +182,15 @@ class Hash end nil end + + ## + # call-seq: + # hsh.to_h -> hsh or new_hash + # + # Returns +self+. If called on a subclass of Hash, converts + # the receiver to a Hash object. + # + def to_h + self + end end |
