Class: Condition::Reader::RedisReader
- Inherits:
-
Object
- Object
- Condition::Reader::RedisReader
- Defined in:
- lib/condition/reader/redis_reader.rb
Instance Method Summary collapse
-
#initialize(redis) ⇒ RedisReader
constructor
A new instance of RedisReader.
- #read_sheet(path, sheet_index) ⇒ Object
Constructor Details
#initialize(redis) ⇒ RedisReader
Returns a new instance of RedisReader.
7 8 9 |
# File 'lib/condition/reader/redis_reader.rb', line 7 def initialize(redis) @redis = redis end |
Instance Method Details
#read_sheet(path, sheet_index) ⇒ Object
11 12 13 14 15 |
# File 'lib/condition/reader/redis_reader.rb', line 11 def read_sheet(path, sheet_index) data = @redis.get(path) raise "redis key name #{path} not found" if data.nil? || data == "" JSON.parse(data, {:symbolize_names => true}) end |