File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -550,21 +550,16 @@ Use :expiration and :expireat options to set default expiration.
550550
551551~~~ ruby
552552value :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
562553value :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+
565561Custom serialization
566562--------------------
567-
568563You can customize how values are serialized by setting ` serializer: CustomSerializer ` .
569564The 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.
590585
591586Author
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.
594589Released under the [ Artistic License] ( http://www.opensource.org/licenses/artistic-license-2.0.php ) .
595-
You can’t perform that action at this time.
0 commit comments