Module: Mobility::Backends::Sequel::ClassMethods

Defined in:
lib/mobility/backends/sequel.rb

Instance Method Summary collapse

Instance Method Details

#[](name, locale) ⇒ Object

Parameters:

  • name (Symbol)

    Attribute name

  • locale (Symbol)

    Locale


12
13
14
# File 'lib/mobility/backends/sequel.rb', line 12

def [](name, locale)
  build_op(name.to_s, locale)
end

#build_op(_attr, _locale) ⇒ Object

Returns Op for this translated attribute.

Parameters:

  • _attr (String)

    Attribute name

  • _locale (Symbol)

    Locale

Returns:

  • Op for this translated attribute

Raises:


19
20
21
# File 'lib/mobility/backends/sequel.rb', line 19

def build_op(_attr, _locale)
  raise NotImplementedError
end

#prepare_dataset(dataset, _predicate, _locale) ⇒ Sequel::Dataset

Returns Prepared dataset.

Parameters:

  • dataset (Sequel::Dataset)

    Dataset to prepare

  • predicate (Object)

    Predicate

  • locale (Symbol)

    Locale

Returns:

  • (Sequel::Dataset)

    Prepared dataset


27
28
29
# File 'lib/mobility/backends/sequel.rb', line 27

def prepare_dataset(dataset, _predicate, _locale)
  dataset
end