Class: Statecraft::Mounting::Builder
- Inherits:
-
Object
- Object
- Statecraft::Mounting::Builder
- Defined in:
- lib/statecraft/mounting.rb
Overview
Performs the mounting steps in threshold order. Every check here works on class hierarchies only — never on the schema and never on a live connection, so mounting is safe at load time.
Instance Method Summary collapse
-
#initialize(model:, machine_class:, log:, column:, changed_at:, versioning:, touch:, helpers:, scopes:) ⇒ Builder
constructor
rubocop:disable Metrics/ParameterLists -- mirrors state_machine's kwargs one-to-one.
-
#mount ⇒ Object
rubocop:enable Metrics/ParameterLists.
Constructor Details
#initialize(model:, machine_class:, log:, column:, changed_at:, versioning:, touch:, helpers:, scopes:) ⇒ Builder
rubocop:disable Metrics/ParameterLists -- mirrors state_machine's kwargs one-to-one
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/statecraft/mounting.rb', line 32 def initialize(model:, machine_class:, log:, column:, changed_at:, versioning:, touch:, helpers:, scopes:) @model = model @machine_class = machine_class @log_option = log @column = column @changed_at = changed_at @versioning = versioning @touch = touch @helpers = helpers @scopes = scopes end |
Instance Method Details
#mount ⇒ Object
rubocop:enable Metrics/ParameterLists
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/statecraft/mounting.rb', line 46 def mount assert_not_mounted log_class = resolve_log_class assert_shared_connection_class(log_class) graph = machine_class.finalize! assert_no_verb_conflicts(graph) assert_no_scope_conflicts(graph) configuration = build_configuration(log_class) store_configuration(configuration) define_scopes(graph, configuration) define_reading_surface model.include(Pipeline::Surface) model.include(Introspection) define_verbs(graph) if @helpers configuration end |