Sha256: a3cb4646623edc5c1e84669396a314768be82d4fc4fa20c2f66b3534476514f9

Contents?: true

Size: 730 Bytes

Versions: 47

Compression:

Stored size: 730 Bytes

Contents

# frozen_string_literal: true

module Spotlight
  module Etl
    # Basic ETL source implementations
    module Sources
      # A simple source that just returns the original resource(s)
      IdentitySource = lambda do |context|
        Array.wrap(context.resource)
      end

      # A transform step that calls a method on the resource to generate a source
      def self.SourceMethodSource(method) # rubocop:disable Naming/MethodName
        lambda do |context|
          context.resource.public_send(method)
        end
      end

      # A simple source that retrieves the stored data from a Spotlight::Resource
      StoredData = lambda do |context, **|
        Array.wrap(context.resource.data)
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
blacklight-spotlight-4.3.6 app/services/spotlight/etl/sources.rb
blacklight-spotlight-4.3.5 app/services/spotlight/etl/sources.rb
blacklight-spotlight-4.3.4 app/services/spotlight/etl/sources.rb
blacklight-spotlight-4.3.3 app/services/spotlight/etl/sources.rb
blacklight-spotlight-4.3.2 app/services/spotlight/etl/sources.rb
blacklight-spotlight-4.3.1 app/services/spotlight/etl/sources.rb
blacklight-spotlight-4.3.0 app/services/spotlight/etl/sources.rb
blacklight-spotlight-4.2.0 app/services/spotlight/etl/sources.rb
blacklight-spotlight-4.1.2 app/services/spotlight/etl/sources.rb
blacklight-spotlight-4.1.1 app/services/spotlight/etl/sources.rb
blacklight-spotlight-4.1.0 app/services/spotlight/etl/sources.rb
blacklight-spotlight-4.0.3 app/services/spotlight/etl/sources.rb
blacklight-spotlight-4.0.2 app/services/spotlight/etl/sources.rb
blacklight-spotlight-4.0.1 app/services/spotlight/etl/sources.rb
blacklight-spotlight-4.0.0 app/services/spotlight/etl/sources.rb
blacklight-spotlight-3.6.0.beta10 app/services/spotlight/etl/sources.rb
blacklight-spotlight-3.6.0.beta9 app/services/spotlight/etl/sources.rb
blacklight-spotlight-3.6.0.beta8 app/services/spotlight/etl/sources.rb
blacklight-spotlight-3.5.0.4 app/services/spotlight/etl/sources.rb
blacklight-spotlight-3.6.0.beta7 app/services/spotlight/etl/sources.rb