Class: WurflCloud::Cache::Cookie

Inherits:
Object
  • Object
show all
Defined in:
lib/wurfl_cloud/cache/cookie.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, environment) ⇒ Cookie

Returns a new instance of Cookie.



9
10
11
# File 'lib/wurfl_cloud/cache/cookie.rb', line 9

def initialize(options, environment)
  @env = environment
end

Instance Attribute Details

#mtimeObject

Returns the value of attribute mtime.



13
14
15
# File 'lib/wurfl_cloud/cache/cookie.rb', line 13

def mtime
  @mtime
end

Instance Method Details

#[](key) ⇒ Object

Should return the value stored for the key, nil if the key is not in cache The Cookie cache always returns the value of the env (no matter what the key)



26
27
28
# File 'lib/wurfl_cloud/cache/cookie.rb', line 26

def [](key)
  @env['wurfl.cookie.device_cache']
end

#[]=(key, value) ⇒ Object

Sets the value in the cache, for the Cookie cache it sets the env



31
32
33
# File 'lib/wurfl_cloud/cache/cookie.rb', line 31

def []=(key, value)
  @env['wurfl.cookie.device_cache'] = value
end

#validate(current_mtime) ⇒ Object

Validates the cache it’s a no-op in the cookie cache



21
22
# File 'lib/wurfl_cloud/cache/cookie.rb', line 21

def validate(current_mtime)
end