I happened to stumble upon this by trying some kind of code in pry :
>> Date.new(2015, 1, 8) ArgumentError: wrong number of arguments (3 for 0) from (pry):6:in `initialize' >> require 'date' => true >> Date.new(2015, 1, 8) => #<Date: 2015-01-08 ((2457031j,0s,0n),+0s,2299161j)>
Note. This is a pure Pry run, there are no custom constants named Date .
Questions:
- Is there a default
Date object already defined in Ruby ? - What exactly is required for
require 'date' ? - Why is there such a variation in behavior?
date ruby ruby-on-rails
Jikku jose
source share