Sha256: a51da12cc74f7985de9d1b912071e3bd66ee53b30ac0c8592ddb5114374d43c7

Contents?: true

Size: 471 Bytes

Versions: 1

Compression:

Stored size: 471 Bytes

Contents

# coding: utf-8
# $Id: date.rb 108 2009-02-09 06:04:39Z yuyakato $

require "rubygems"
require "kagemusha/date"

p Date.today.strftime("%Y-%m-%d") #=> today

# Normal Style.
musha = Kagemusha::Date.on(2007, 1, 1)
musha.swap {
  p Date.today.strftime("%Y-%m-%d") #=> 2007-01-01
}

p Date.today.strftime("%Y-%m-%d") #=> today

# Block Style.
Kagemusha::Date.on(2007, 1, 1) {
  p Date.today.strftime("%Y-%m-%d") #=> 2007-01-01
}

p Date.today.strftime("%Y-%m-%d") #=> today

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nayutaya-kagemusha-0.0.9 examples/date.rb