Class: Operations::Components::Prechecks

Inherits:
Base
  • Object
show all
Defined in:
lib/operations/components/prechecks.rb

Overview

Contains common logic for policies and preconditions.

Direct Known Subclasses

Idempotency, Policies, Preconditions

Constant Summary

Constants inherited from Base

Base::DEFAULT_NAMES_MAP, Base::MONADS_DO_WRAPPER_SIGNATURES

Instance Method Summary collapse

Instance Method Details

#callable?(context) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/operations/components/prechecks.rb', line 9

def callable?(context)
  (required_context - context.keys).empty?
end

#required_contextObject



13
14
15
# File 'lib/operations/components/prechecks.rb', line 13

def required_context
  @required_context ||= required_kwargs | context_keys
end