Skip to content

Instantly share code, notes, and snippets.

@korny
Created December 17, 2014 11:14
Show Gist options
  • Save korny/4f6ea67986d3d5efa462 to your computer and use it in GitHub Desktop.
Save korny/4f6ea67986d3d5efa462 to your computer and use it in GitHub Desktop.
Ruby 1.8/1.9 change regarding super inside a proc
class Human
def self.speak what
what
end
end
class Pirate < Human
def self.speak what
proc { super }.call
end
end
# RUBY_VERSION "1.8.7"
Pirate.speak('Hi!') # wrong number of arguments (0 for 1) (ArgumentError)
# RUBY_VERSION "2.0.0"
Pirate.speak('Hi!') # nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment