Skip to content

Instantly share code, notes, and snippets.

@evanphx
Created November 4, 2010 23:18
Show Gist options
  • Save evanphx/663383 to your computer and use it in GitHub Desktop.
Save evanphx/663383 to your computer and use it in GitHub Desktop.
class BadNews < String
def initialize(required)
@age = required
super "hello"
end
attr_reader :age
end
b = BadNews.new(10)
p b
c = b.gsub("l", "r")
p c
p c.class
p c.age
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment