Skip to content

Instantly share code, notes, and snippets.

@Vaysman
Created April 1, 2015 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vaysman/54f50ed98debfeab8550 to your computer and use it in GitHub Desktop.
Save Vaysman/54f50ed98debfeab8550 to your computer and use it in GitHub Desktop.
To demonstrate strange behaviour in ruby-ncurses gem
class A
def to_s
"class a"
end
end
class B
def B.new()
A.new()
end
def to_s
"class b"
end
end
class C < B
def initialize
super
end
def to_s
"class c"
end
end
c = C.new
c.to_s # => "class a"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment