Sha256: 69f51995ea371b001ef038bf7a25f6382c867e74a4c858e82b6bee5cfdfb7dce
Contents?: true
Size: 706 Bytes
Versions: 31
Compression:
Stored size: 706 Bytes
Contents
module Mobility module Backends =begin Backend which stores translations in an in-memory hash. =end class Hash include Backend # @!group Backend Accessors # @!macro backend_reader # @return [Object] def read(locale, _ = {}) translations[locale] end # @!macro backend_writer # @return [Object] def write(locale, value, _ = {}) translations[locale] = value end # @!endgroup # @!macro backend_iterator def each_locale translations.each { |l, _| yield l } end private def translations @translations ||= {} end end register_backend(:hash, Hash) end end
Version data entries
31 entries across 31 versions & 1 rubygems