Module: Stepped

Defined in:
lib/stepped.rb,
lib/stepped/engine.rb,
lib/stepped/version.rb

Defined Under Namespace

Modules: Actionable, TestHelper Classes: Achievement, Action, ActionJob, Arguments, CompleteActionJob, Definition, Engine, Performance, Registry, Step, TimeoutJob, WaitJob

Constant Summary collapse

VERSION =
"1.0.2"

Class Method Summary collapse

Class Method Details

.checksum(value) ⇒ Object



22
23
24
25
# File 'lib/stepped.rb', line 22

def self.checksum(value)
  return if value.nil?
  Digest::SHA256.hexdigest JSON.dump(value)
end

.handle_exception(context: {}) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/stepped.rb', line 13

def self.handle_exception(context: {})
  yield
  true
rescue StandardError => e
  raise unless handled_exception_classes.any? { e.class <= _1 }
  Rails.error.report(e, handled: false, context:)
  false
end

.handled_exception_classesObject



9
10
11
# File 'lib/stepped.rb', line 9

def self.handled_exception_classes
  Array(Stepped::Engine.config.stepped_actions.handle_exceptions)
end

.table_name_prefixObject



5
6
7
# File 'lib/stepped.rb', line 5

def self.table_name_prefix
  "stepped_"
end