Sha256: 8f8982d5696954348eea0c0be4b11e9d4cdf15cf91cbd2e1462c7696a67ea529

Contents?: true

Size: 942 Bytes

Versions: 1

Compression:

Stored size: 942 Bytes

Contents

#==============================================================================#
# $Id: time.rb 27 2007-08-15 14:35:31Z yuyakato $
#==============================================================================#

require "kagemusha"

#==============================================================================#

class Kagemusha #:nodoc:
  module Time #:nodoc:
    def self.at(time_or_year, mon = 1, mday = 1, hour = 0, min = 0, sec = 0)
      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
  end
end

#==============================================================================#
#==============================================================================#

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kagemusha-0.0.1 lib/kagemusha/time.rb