Class: DateTime
- Inherits:
-
Object
- Object
- DateTime
- Defined in:
- lib/activefacts/api/numeric.rb
Overview
A DateTime can be constructed from any Date or DateTime subclass
Class Method Summary collapse
-
.new(*a, &b) ⇒ Object
DateTime.new cannot normally be called passing a Date or DateTime as the parameter.
- .old_new ⇒ Object
Class Method Details
.new(*a, &b) ⇒ Object
DateTime.new cannot normally be called passing a Date or DateTime as the parameter. This allows that.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/activefacts/api/numeric.rb', line 89 def self.new(*a, &b) #puts "Constructing DateTime with #{a.inspect} from #{caller*"\n\t"}" if (a.size == 1) a = a[0] if (DateTime === a) civil(a.year, a.month, a.day, a.hour, a.min, a.sec, a.start) elsif (Date === a) civil(a.year, a.month, a.day, a.start) else civil(*a, &b) end else civil(*a, &b) end end |
.old_new ⇒ Object
87 |
# File 'lib/activefacts/api/numeric.rb', line 87 alias_method :old_new, :new |