Skip to content

Instantly share code, notes, and snippets.

@erik-megarad
Created March 14, 2014 21:06
Show Gist options
  • Save erik-megarad/9556917 to your computer and use it in GitHub Desktop.
Save erik-megarad/9556917 to your computer and use it in GitHub Desktop.
irb(main):001:0> require 'stringio'
=> true
irb(main):002:0> StringIO.ancestors
=> [StringIO, IO::writable, IO::readable, Enumerable, Data, Object, Kernel, BasicObject]
irb(main):003:0> StringIO.ancestors[1]
=> IO::writable
irb(main):004:0> Object.const_get(StringIO.ancestors[1].to_s)
NameError: wrong constant name IO::writable
from (irb):4:in `const_get'
from (irb):4
from /Users/epeterson/.rubies/ruby-1.9.3-p448/bin/irb:12:in `<main>'
irb(main):005:0> IO::writable
NoMethodError: undefined method `writable' for IO:Class
from (irb):5
from /Users/epeterson/.rubies/ruby-1.9.3-p448/bin/irb:12:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment