Skip to content

@kaos12 /gist:963819
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Overriding method by another defined in module - Ruby
C:\Users\kaos12>irb
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
irb(main):004:0> Date.new.next
=> #<Date: 1/2,0,2299161>
irb(main):005:0> Date.new.next(:world)
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
Something went wrong with that request. Please try again.