Module: Kagemusha::Time
- Defined in:
- lib/kagemusha/time.rb
Overview
:nodoc:
Class Method Summary collapse
Class Method Details
.at(time_or_year, mon = 1, mday = 1, hour = 0, min = 0, sec = 0, &block) ⇒ Object
:nodoc:
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/kagemusha/time.rb', line 13 def self.at(time_or_year, mon = 1, mday = 1, hour = 0, min = 0, sec = 0, &block) if block_given? return self.at(time_or_year, mon, mday, hour, min, sec).swap(&block) end time = case time_or_year when ::Time then time_or_year when ::Integer then ::Time.local(time_or_year, mon, mday, hour, min, sec) else raise(ArgumentError, "?") # FIXME: message end musha = Kagemusha.new(::Time) musha.defs(:now) { time } return musha end |