Class: Mobility::Backends::Sequel::Jsonb

Inherits:
PgHash
  • Object
show all
Defined in:
lib/mobility/backends/sequel/jsonb.rb

Overview

Implements the Jsonb backend for Sequel models.

See Also:

  • HashValued

Defined Under Namespace

Classes: QueryMethods

Backend Accessors collapse

Methods inherited from PgHash

#each_locale, #translations

Methods included from HashValued

#each_locale

Methods included from Mobility::Backends::Sequel

included, #setup_query_methods

Instance Method Details

#read(locale, **options) ⇒ String, ...

Note:

Translation may be string, integer or boolean-valued since value is stored on a JSON hash.

Returns Value of translation.

Parameters:

  • locale (Symbol)

    Locale to read

  • options (Hash)

Returns:

  • (String, Integer, Boolean)

    Value of translation



# File 'lib/mobility/backends/sequel/jsonb.rb', line 15

#write(locale, value, **options) ⇒ String, ...

Note:

Translation may be string, integer or boolean-valued since value is stored on a JSON hash.

Returns Updated value.

Parameters:

  • locale (Symbol)

    Locale to write

  • value (String, Integer, Boolean)

    Value to write

  • options (Hash)

Returns:

  • (String, Integer, Boolean)

    Updated value



33
# File 'lib/mobility/backends/sequel/jsonb.rb', line 33

setup_query_methods(QueryMethods)