Sha256: 86e4fa784c3e54ec0bf10786786db24f1426258330465d1fa63ba967e7a6e83d

Contents?: true

Size: 974 Bytes

Versions: 2

Compression:

Stored size: 974 Bytes

Contents

# frozen_string_literal: true
require "mobility/backend"

module Mobility
  module Backends
    module Sequel
      def self.included(backend_class)
        backend_class.include Backend
        backend_class.extend ClassMethods
      end

      module ClassMethods
        # @param [Symbol] name Attribute name
        # @param [Symbol] locale Locale
        def [](name, locale)
          build_op(name.to_s, locale)
        end

        # @param [String] _attr Attribute name
        # @param [Symbol] _locale Locale
        # @return Op for this translated attribute
        def build_op(_attr, _locale)
          raise NotImplementedError
        end

        # @param [Sequel::Dataset] dataset Dataset to prepare
        # @param [Object] predicate Predicate
        # @param [Symbol] locale Locale
        # @return [Sequel::Dataset] Prepared dataset
        def prepare_dataset(dataset, _predicate, _locale)
          dataset
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mobility-1.0.0.beta2 lib/mobility/backends/sequel.rb
mobility-1.0.0.beta1 lib/mobility/backends/sequel.rb