class Translator::Store

Public Class Methods

new(type = Translator.storage, options = Translator.storage_options) click to toggle source
# File lib/translator/store.rb, line 10
def initialize(type = Translator.storage, options = Translator.storage_options)
  @type    = type # can be removed
  @options = options # can be removed
  @storage = Moneta.new(type, options)
end

Public Instance Methods

[](key)
Alias for: read
[]=(key, value)
Alias for: write
load_files(paths) click to toggle source
# File lib/translator/store.rb, line 29
def load_files(paths)
  paths = (Array(paths) + Translator.default_file_paths).uniq
  YamlFileFlattener.new(paths).process.each { |language, data| write(language, data) }
end
read(key) click to toggle source
# File lib/translator/store.rb, line 24
def read(key)
  @storage[key]
end
Also aliased as: []
write(key, value) click to toggle source
# File lib/translator/store.rb, line 19
def write(key, value)
  @storage[key] = value
end
Also aliased as: []=