Class: Trifle::Loader
- Inherits:
-
Object
- Object
- Trifle::Loader
- Includes:
- InitializeWithRedis
- Defined in:
- lib/trifle/loader.rb
Instance Attribute Summary
Attributes included from InitializeWithRedis
Instance Method Summary collapse
Methods included from InitializeWithRedis
Instance Method Details
#clear ⇒ Object
25 26 27 |
# File 'lib/trifle/loader.rb', line 25 def clear redis.del key end |
#handle(options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/trifle/loader.rb', line 9 def handle = {} if [:filename] load_files [[:filename]] elsif [:filenames] load_files [:filenames] elsif [:data] load_data [:data] else raise ArgumentError.new("Please provide a :filename, :filenames or an array of :data as an argument.") end end |
#tmp_key ⇒ Object
21 22 23 |
# File 'lib/trifle/loader.rb', line 21 def tmp_key "#{key}:tmp" end |