Class: Date
- Inherits:
-
Object
- Object
- Date
- Defined in:
- lib/activefacts/api/numeric.rb
Overview
A Date can be constructed from any Date subclass, not just using the normal date constructors.
Direct Known Subclasses
Class Method Summary collapse
-
.new(*a, &b) ⇒ Object
Date.new cannot normally be called passing a Date as the parameter.
- .old_new ⇒ Object
Class Method Details
.new(*a, &b) ⇒ Object
Date.new cannot normally be called passing a Date as the parameter. This allows that.
72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/activefacts/api/numeric.rb', line 72 def self.new(*a, &b) #puts "Constructing date with #{a.inspect} from #{caller*"\n\t"}" if (a.size == 1 && a[0].is_a?(Date)) a = a[0] civil(a.year, a.month, a.day, a.start) elsif (a.size == 1 && a[0].is_a?(String)) parse(a[0]) else civil(*a, &b) end end |
.old_new ⇒ Object
70 |
# File 'lib/activefacts/api/numeric.rb', line 70 alias_method :old_new, :new |