Guest User

Untitled

a guest
Nov 20th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. a = 'foo'
  2. class << a
  3. def inspect
  4. '"bar"'
  5. end
  6. end
  7. a.inspect # => "bar"
  8.  
  9. a = 'foo' # new object, new singleton class
  10. a.inspect # => "foo"
Add Comment
Please, Sign In to add comment