Module: Mobility::Plugins::Presence::BackendMethods
- Defined in:
- lib/mobility/plugins/presence.rb
Backend Accessors collapse
-
#read(locale, **options) ⇒ Object
Gets the translated value for provided locale from configured backend.
-
#write(locale, value, **options) ⇒ Object
Updates translation for provided locale without calling backend’s methods to persist the changes.
Instance Method Details
#read(locale, **options) ⇒ Object
Gets the translated value for provided locale from configured backend.
31 32 33 |
# File 'lib/mobility/plugins/presence.rb', line 31 def read(locale, **) .delete(:presence) == false ? super : Presence[super] end |
#write(locale, value, **options) ⇒ Object
Updates translation for provided locale without calling backend’s methods to persist the changes.
38 39 40 41 42 43 44 |
# File 'lib/mobility/plugins/presence.rb', line 38 def write(locale, value, **) if .delete(:presence) == false super else super(locale, Presence[value], **) end end |