Module: ResearchMetadataBatch::Shared

Included in:
Base
Defined in:
lib/research_metadata_batch/shared.rb

Overview

Note:

These methods (except init) are used internally by Base#process and have been left public for documentation purposes only

Instance Method Summary collapse

Instance Method Details

#act(model) ⇒ Hash?

Do something with model metadata

Returns:

  • (Hash, nil)

    Optionally, return something transaction-specific, such as a code/ID from an external service.



18
19
20
# File 'lib/research_metadata_batch/shared.rb', line 18

def act(model)
  puts model.inspect
end

#init(**args) ⇒ Object

Second stage initialisation, perhaps third party services.

Parameters:

  • args (Hash)


8
9
# File 'lib/research_metadata_batch/shared.rb', line 8

def init(**args)
end

#preflightHash?

Anything to be done at the start of a batch run

Returns:

  • (Hash, nil)

    Optionally, return something to indicate what has been done.



13
14
# File 'lib/research_metadata_batch/shared.rb', line 13

def preflight
end

#valid?(model) ⇒ Boolean

Check for values in metadata.

Returns:

  • (Boolean)


24
25
26
# File 'lib/research_metadata_batch/shared.rb', line 24

def valid?(model)
  true
end