Sha256: 3d2e5188df8c81dfa698538a7f5f599cbb8cd6acd353b07d71659e42a1c7a4f7

Contents?: true

Size: 887 Bytes

Versions: 46

Compression:

Stored size: 887 Bytes

Contents

module EasyML
  module Datasources
    class BaseDatasource
      include ActiveModel::Validations
      include EasyML::Concerns::Configurable

      attr_reader :datasource

      def clean; end

      def before_sync; end

      def after_sync; end

      def initialize(datasource)
        @datasource = datasource
      end

      def query(*)
        raise NotImplementedError
      end

      def in_batches(*)
        raise NotImplementedError
      end

      def files
        raise NotImplementedError
      end

      def last_updated_at
        raise NotImplementedError
      end

      def data
        raise NotImplementedError
      end

      def needs_refresh?
        false
      end

      def refresh
        datasource.syncing do
          # Default implementation does nothing
        end
      end

      def refresh!
        refresh
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
easy_ml-0.2.0.pre.rc47 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc46 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc45 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc44 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc43 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc41 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc40 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc39 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc38 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc37 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc36 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc35 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc34 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc33 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc32 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc31 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc30 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc29 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc28 app/models/easy_ml/datasources/base_datasource.rb
easy_ml-0.2.0.pre.rc27 app/models/easy_ml/datasources/base_datasource.rb