two Date classes?

M

Mark Volkmann

It seems that there is a Date class in the core library and the
standard library. Is this correct? The following code

---

core = Date.methods.sort

require 'date'
std = Date.methods.sort

puts "methods in std Date that aren't in core Date"
puts std - core

---

outputs lots of method names.

Pickaxe doesn't document a Date class in the core libraries.
Does anybody know why there are two classes named Date in the standard
Ruby distribution?
 
L

Logan Capaldo

It seems that there is a Date class in the core library and the
standard library. Is this correct? The following code

---

core = Date.methods.sort

require 'date'
std = Date.methods.sort

puts "methods in std Date that aren't in core Date"
puts std - core

---

outputs lots of method names.

Pickaxe doesn't document a Date class in the core libraries.
Does anybody know why there are two classes named Date in the standard
Ruby distribution?

There aren't. If you have rubygems in your RUBYOPT (or similiar) it
pulls in time.rb which adds some methods to the Date class (and
changes it's behavior slightly). This could be what you are seeing.

 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,208
Messages
2,571,082
Members
47,683
Latest member
AustinFairchild

Latest Threads

Top