summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mrblib/io.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/mrblib/io.rb b/mrblib/io.rb
index 0b10c82aa..08f9180dd 100644
--- a/mrblib/io.rb
+++ b/mrblib/io.rb
@@ -114,6 +114,12 @@ class IO
self
end
+ def hash
+ # We must define IO#hash here because IO includes Enumerable and
+ # Enumerable#hash will call IO#read...
+ self.__id__
+ end
+
def write(string)
str = string.is_a?(String) ? string : string.to_s
return str.size unless str.size > 0