Module: Spotlight::Etl::Sources

Defined in:
app/services/spotlight/etl/sources.rb

Overview

Basic ETL source implementations

Constant Summary collapse

IdentitySource =

A simple source that just returns the original resource(s)

lambda do |context|
  Array.wrap(context.resource)
end
StoredData =

A simple source that retrieves the stored data from a Spotlight::Resource

lambda do |context, **|
  Array.wrap(context.resource.data)
end

Class Method Summary collapse

Class Method Details

.SourceMethodSource(method) ⇒ Object

A transform step that calls a method on the resource to generate a source



13
14
15
16
17
# File 'app/services/spotlight/etl/sources.rb', line 13

def self.SourceMethodSource(method) # rubocop:disable Naming/MethodName
  lambda do |context|
    context.resource.public_send(method)
  end
end