Sha256: 7fcdbedcd3d55ef35bc4148ecd71fd16092010f1b7f40e2043d43ffc6de8910b

Contents?: true

Size: 598 Bytes

Versions: 8

Compression:

Stored size: 598 Bytes

Contents

# frozen_string_literal: true

module Lite
  module Query
    class Base

      attr_accessor :relation
      attr_reader :args

      class << self

        def call(relation = nil, **args)
          klass = new(relation, args)
          klass.call
        end

      end

      def initialize(relation = nil, **args)
        @relation = relation || default_relation
        @args = args
      end

      def call
        raise Lite::Query::NotImplementedError unless defined?(execute)

        execute
      end

      private

      def default_relation
        nil
      end

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
lite-query-1.0.7 lib/lite/query/base.rb
lite-query-1.0.6 lib/lite/query/base.rb
lite-query-1.0.5 lib/lite/query/base.rb
lite-query-1.0.4 lib/lite/query/base.rb
lite-query-1.0.3 lib/lite/query/base.rb
lite-query-1.0.2 lib/lite/query/base.rb
lite-query-1.0.1 lib/lite/query/base.rb
lite-query-1.0.0 lib/lite/query/base.rb