Permalink
Browse files

Modify the README

  • Loading branch information...
linhchauatl committed Mar 22, 2013
1 parent 61c89ec commit 9843cb3ad90dd5698a274160f24b81e6848ea03f
Showing with 11 additions and 11 deletions.
  1. +11 −11 README.md
View
@@ -1,23 +1,23 @@
This is a gem that provides Ruby objects with the capability of object caching. This gem is framework-agnostic, so it can be used in all the types of Ruby applications.
Object that wants to be cached must include Cacheable,
-`
+
class Person
- include Cacheable
+ include Cacheable
end
-`
+
and implement the method:
-`
+
def self.fetch(attributes,args)
- # Your code to do the real object retrieval here
- # It can be database call, webservices call or complex object builder
- # The first argument attributes is an array of attribute names that we want to retrieve the object by
- # The second argument args is an array of values of the attributes
- # for example Person.fetch(['first_name', 'last_name'], ['Linh', 'Chau'])
- # But the combinations of attributes must be able to identify a unique object
+ # Your code to do the real object retrieval here
+ # It can be database call, webservices call or complex object builder
+ # The first argument attributes is an array of attribute names that we want to retrieve the object by
+ # The second argument args is an array of values of the attributes
+ # for example Person.fetch(['first_name', 'last_name'], ['Linh', 'Chau'])
+ # But the combinations of attributes must be able to identify a unique object
end
-`
+
When a Class includes Cacheable and defines the method "fetch", it's instances will become cacheable, and all the cache operations will be handled by the module Cacheable.

0 comments on commit 9843cb3

Please sign in to comment.