Skip to content

Commit 4854553

Browse files
committed
updated README on expireat
1 parent 0685cbc commit 4854553

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

README.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -550,21 +550,16 @@ Use :expiration and :expireat options to set default expiration.
550550

551551
~~~ruby
552552
value :value_with_expiration, :expiration => 1.hour
553-
value :value_with_expireat, :expireat => Time.now + 1.hour
554-
~~~
555-
556-
:warning: `expireat` is evaluated at class load time.
557-
In this example, it will be one hour after evaluating class, not after one hour after setting value.
558-
559-
If you want to expire one hour after setting the value. please use `lambda`.
560-
561-
~~~ruby
562553
value :value_with_expireat, :expireat => lambda { Time.now + 1.hour }
563554
~~~
564555

556+
:warning: In the above example, `expiration` is evaluated at class load time.
557+
In this example, it will be one hour after loading the class, not after one hour
558+
after setting a value. If you want to expire one hour after setting the value,
559+
please use `:expireat` with `lambda`.
560+
565561
Custom serialization
566562
--------------------
567-
568563
You can customize how values are serialized by setting `serializer: CustomSerializer`.
569564
The default is `Marshal` from the standard lib, but it can be anything that responds to `dump` and
570565
`load`. `JSON` and `YAML` are popular options.
@@ -590,6 +585,5 @@ end
590585

591586
Author
592587
=======
593-
Copyright (c) 2009-2013 [Nate Wiger](http://nateware.com). All Rights Reserved.
588+
Copyright (c) 2009-2019 [Nate Wiger](http://nateware.com). All Rights Reserved.
594589
Released under the [Artistic License](http://www.opensource.org/licenses/artistic-license-2.0.php).
595-

0 commit comments

Comments
 (0)