Method: Lotus::Utils::Kernel.Date
- Defined in:
- lib/lotus/utils/kernel.rb
.Date(arg) ⇒ Date
Coerces the argument to be a Date.
727 728 729 730 731 732 733 734 735 |
# File 'lib/lotus/utils/kernel.rb', line 727 def self.Date(arg) if arg.respond_to?(:to_date) arg.to_date else Date.parse(arg.to_s) end rescue ArgumentError, NoMethodError raise TypeError.new "can't convert #{inspect_type_error(arg)}into Date" end |