Skip to content

Commit

Permalink
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 0 additions & 6 deletions spec/truffle/tags/core/hash/to_proc_tags.txt

This file was deleted.

7 changes: 7 additions & 0 deletions truffle/src/main/ruby/core/hash.rb
Original file line number Diff line number Diff line change
@@ -431,6 +431,13 @@ def to_hash
self
end

def to_proc
Proc.new do |key=undefined|
raise ArgumentError, "wrong number of arguments (given 0, expected 1)" if undefined.equal?(key)
self[key]
end
end

# Implementation of a fundamental Rubinius method that allows their Hash
# implementation to work. We probably want to remove uses of this in the long
# term, as it creates objects which already exist for them and we have to

0 comments on commit 8182745

Please sign in to comment.