Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Can now get and set arbitrary data in Redis.
- Loading branch information
T.J. VanSlyke
committed
May 9, 2011
1 parent
78770e8
commit bbb36a5
Showing
5 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class Redis | ||
|
||
def initialize(options={}) | ||
@hashes = {} | ||
end | ||
|
||
def hset(name, key, value) | ||
@hashes[name] ||= {} | ||
@hashes[name][key] = value | ||
end | ||
|
||
def hget(name, key) | ||
@hashes[name] ||= {} | ||
@hashes[name][key] | ||
end | ||
|
||
end | ||
|