Project

General

Profile

Actions

Bug #7873

closed

StringIO does not respond to to_io

Added by ueno (Daiki Ueno) about 11 years ago. Updated about 11 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-linux]
Backport:
[ruby-core:52310]

Description

In my project, I'm using "object.respond_to? :to_io" to check if the object is IO-ish[1].
(I heard that this is the preferred way to do that some time ago.)

However, StringIO does not seem to define to_io. Is this intended?

[1] https://github.com/ueno/ruby-gpgme/pull/18

Updated by drbrain (Eric Hodel) about 11 years ago

  • Category set to ext
  • Status changed from Open to Rejected

It is intended. StringIO only pretends to be an IO, it is not backed by a socket or file like an IO is.

Actions

Also available in: Atom PDF

Like0
Like0