Module: Chronos::Ports::ContextStore

Defined in:
lib/chronos/ports/context_store.rb

Overview

Conceptual storage port for execution-scoped context.

Examples:

Chronos::Ports::ContextStore.compatible?(store) #=> true

Constant Summary collapse

REQUIRED_METHODS =
[:get, :set, :clear, :with_context].freeze

Class Method Summary collapse

Class Method Details

.compatible?(object) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/chronos/ports/context_store.rb', line 17

def self.compatible?(object)
  REQUIRED_METHODS.all? { |method_name| object.respond_to?(method_name) }
end