Class: Formtastic::Localizer::Cache
- Inherits:
-
Object
- Object
- Formtastic::Localizer::Cache
- Defined in:
- lib/formtastic/localizer.rb
Instance Method Summary collapse
- #cache ⇒ Object
- #clear! ⇒ Object
- #get(key) ⇒ Object
- #has_key?(key) ⇒ Boolean
- #set(key, result) ⇒ Object
Instance Method Details
#cache ⇒ Object
40 41 42 |
# File 'lib/formtastic/localizer.rb', line 40 def cache @cache ||= {} end |
#clear! ⇒ Object
44 45 46 |
# File 'lib/formtastic/localizer.rb', line 44 def clear! cache.clear end |
#get(key) ⇒ Object
28 29 30 |
# File 'lib/formtastic/localizer.rb', line 28 def get(key) cache[key] end |
#has_key?(key) ⇒ Boolean
32 33 34 |
# File 'lib/formtastic/localizer.rb', line 32 def has_key?(key) cache.has_key?(key) end |
#set(key, result) ⇒ Object
36 37 38 |
# File 'lib/formtastic/localizer.rb', line 36 def set(key, result) cache[key] = result end |