Sha256: 4f30edf19d8eebc8bc56e4a8a59a9f9e37081835d0157c56b3edf667d112aac4

Contents?: true

Size: 719 Bytes

Versions: 27

Compression:

Stored size: 719 Bytes

Contents

module EasyML
  module Adapters
    class BaseAdapter
      attr_reader :datasource

      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

27 entries across 27 versions & 1 rubygems

Version Path
easy_ml-0.2.0.pre.rc27 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc26 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc25 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc24 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc23 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc22 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc21 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc20 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc19 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc18 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc17 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc16 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc15 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc14 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc13 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc12 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc11 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc10 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc9 app/models/easy_ml/adapters/base_adapter.rb
easy_ml-0.2.0.pre.rc8 app/models/easy_ml/adapters/base_adapter.rb