class I18n::PostgresJson::KeyValue::Store

Public Instance Methods

[](key) click to toggle source
# File lib/i18n/postgres_json/key_value/store.rb, line 5
def [](key)
  record[escape(key)]
end
[]=(key, value) click to toggle source
# File lib/i18n/postgres_json/key_value/store.rb, line 9
def []=(key, value)
  record[escape(key)] = value
end
keys() click to toggle source
# File lib/i18n/postgres_json/key_value/store.rb, line 13
def keys
  record.keys
end

Private Instance Methods

escape(key) click to toggle source
# File lib/i18n/postgres_json/key_value/store.rb, line 19
def escape(key)
  key.gsub(
    I18n::Backend::Flatten::SEPARATOR_ESCAPE_CHAR,
    I18n.default_separator
  )
end
record() click to toggle source
# File lib/i18n/postgres_json/key_value/store.rb, line 26
def record
  Translation.first_or_initialize
end