Sha256: f7e807f2c68c5e210d595559e1a7e1ea5eb4c32957638cb83fc87b40081bb8d5

Contents?: true

Size: 515 Bytes

Versions: 1

Compression:

Stored size: 515 Bytes

Contents

# coding: utf-8
# $Id: first.rb 120 2009-02-09 08:22:25Z yuyakato $

require "rubygems"
require "kagemusha"

musha = Kagemusha.new(Time)
musha.defs(:now) { self.local(1984, 5, 11) }
musha.def(:+) { |other| other }

p Time.now                #=> now
p Time.now + 60 * 60 * 24 #=> now + 24 hours
puts "---"

musha.swap {
  p Time.now                #=> 1984-05-11 00:00:00
  p Time.now + 60 * 60 * 24 #=> 86400
  puts "---"
}

p Time.now                #=> now
p Time.now + 60 * 60 * 24 #=> now + 24 hours
puts "---"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kagemusha-0.0.8 examples/first.rb