Class: Formtastic::Localizer::Cache

Inherits:
Object
  • Object
show all
Defined in:
lib/formtastic/localizer.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) cache



40
41
42
# File 'lib/formtastic/localizer.rb', line 40

def cache
  @cache ||= {}
end

- (Object) clear!



44
45
46
# File 'lib/formtastic/localizer.rb', line 44

def clear!
  cache.clear
end

- (Object) get(key)



28
29
30
# File 'lib/formtastic/localizer.rb', line 28

def get(key)
  cache[key]
end

- (Boolean) has_key?(key)

Returns:

  • (Boolean)


32
33
34
# File 'lib/formtastic/localizer.rb', line 32

def has_key?(key)
  cache.has_key?(key)
end

- (Object) set(key, result)



36
37
38
# File 'lib/formtastic/localizer.rb', line 36

def set(key, result)
  cache[key] = result
end