Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Modify the README

  • Loading branch information...
commit 9843cb3ad90dd5698a274160f24b81e6848ea03f 1 parent 61c89ec
@chauhonglinh2 chauhonglinh2 authored
Showing with 11 additions and 11 deletions.
  1. +11 −11 README.md
View
22 README.md
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.