Class: Sneaql::Core::StepMetadataManager

Inherits:
Object
  • Object
show all
Defined in:
lib/sneaql_lib/base.rb

Overview

abstracted to allow this metadata to come from any source

Direct Known Subclasses

StepManagers::JSONFileStepManager

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params, logger = nil) ⇒ StepMetadataManager

Returns a new instance of StepMetadataManager.

Parameters:

  • params (Hash)

    parameters passed to transform will be passed here

  • logger (Logger) (defaults to: nil)

    object otherwise will default to new Logger



260
261
262
263
264
265
266
267
268
# File 'lib/sneaql_lib/base.rb', line 260

def initialize(params, logger = nil)
  @logger = logger ? logger : Logger.new(STDOUT)
  @params = params
  manage_steps
rescue => e
  @logger.error(e.message)
  e.backtrace { |r| @logger.error(r) }
  raise e
end

Instance Attribute Details

#stepsObject (readonly)

value should be array of metadata hashes in the form ‘{ step_number: j, step_file: j }`



256
257
258
# File 'lib/sneaql_lib/base.rb', line 256

def steps
  @steps
end

Instance Method Details

#manage_stepsObject

override with a method that will override steps with an array of steps in the format :step_number, :step_file



272
273
274
# File 'lib/sneaql_lib/base.rb', line 272

def manage_steps
  nil
end