Class: HTTParty::Icebox::Store::AbstractStore

Inherits:
Object
  • Object
show all
Defined in:
lib/tmdb_party/extras/httparty_icebox.rb

Overview

Abstract Store

Inherit your store from this class IMPORTANT: Do not forget to call super in your initialize method!

Direct Known Subclasses

FileStore, MemoryStore

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ AbstractStore

Returns a new instance of AbstractStore.

Raises:

  • (ArgumentError)


155
156
157
158
159
160
161
162
163
# File 'lib/tmdb_party/extras/httparty_icebox.rb', line 155

def initialize(options={})
  raise ArgumentError, "You need to set the :timeout parameter" unless options[:timeout]
  @timeout = options[:timeout]
  message =  "Cache: Using #{self.class.to_s.split('::').last}"
  message << " in location: #{options[:location]}" if options[:location]
  message << " with timeout #{options[:timeout]} sec"
  Cache.logger.info message unless options[:logger].nil?
  return self
end