Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Overriding method by another defined in module - Ruby
irb(main):001:0> require 'date'
=> true
irb(main):002:0> module Foo; def next(a=:hi); a; end; end
=> nil
irb(main):003:0> class Date; include Foo; end
=> Date
=> #<Date: 1/2,0,2299161>
ArgumentError: wrong number of arguments (1 for 0)
from (irb):5:in `next'
from (irb):5
from ♥:0
irb(main):006:0> RUBY_DESCRIPTION
=> "ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment