event_engine 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +55 -0
  3. data/README.md +210 -399
  4. data/Rakefile +0 -1
  5. data/lib/event_engine/catalog_entry.rb +84 -0
  6. data/lib/event_engine/configuration.rb +9 -9
  7. data/lib/event_engine/definition_publisher.rb +22 -0
  8. data/lib/event_engine/event.rb +0 -8
  9. data/lib/event_engine/event_builder.rb +0 -8
  10. data/lib/event_engine/event_schema.rb +32 -57
  11. data/lib/event_engine/event_schema_json_loader.rb +19 -0
  12. data/lib/event_engine/handler_registry.rb +4 -4
  13. data/lib/event_engine/invalid_rules_error.rb +8 -0
  14. data/lib/event_engine/processing_rules.rb +39 -0
  15. data/lib/event_engine/processor_registry.rb +19 -0
  16. data/lib/event_engine/processor_resolver.rb +16 -0
  17. data/lib/event_engine/railtie.rb +54 -4
  18. data/lib/event_engine/rules_file.rb +14 -0
  19. data/lib/event_engine/schema_catalog_builder.rb +18 -0
  20. data/lib/event_engine/schema_registry.rb +7 -58
  21. data/lib/event_engine/unregistered_processor_error.rb +8 -0
  22. data/lib/event_engine/unroutable_event_error.rb +9 -0
  23. data/lib/event_engine/unrouted_events_error.rb +9 -0
  24. data/lib/event_engine/version.rb +1 -1
  25. data/lib/event_engine.rb +117 -123
  26. data/lib/tasks/event_engine_catalog.rake +15 -6
  27. data/lib/tasks/event_engine_rules.rake +10 -0
  28. data/the_local/agents/event_engine-develop.md +154 -0
  29. data/the_local/agents/event_engine-info.md +82 -0
  30. data/the_local/agents/event_engine-install.md +99 -0
  31. data/the_local/interface.yml +27 -0
  32. metadata +45 -48
  33. data/app/assets/config/event_engine_manifest.js +0 -1
  34. data/app/assets/stylesheets/event_engine/application.css +0 -15
  35. data/app/controllers/event_engine/application_controller.rb +0 -4
  36. data/app/helpers/event_engine/application_helper.rb +0 -4
  37. data/app/jobs/event_engine/application_job.rb +0 -4
  38. data/app/mailers/event_engine/application_mailer.rb +0 -6
  39. data/app/models/event_engine/application_record.rb +0 -5
  40. data/app/views/layouts/event_engine/application.html.erb +0 -15
  41. data/config/routes.rb +0 -2
  42. data/lib/event_engine/definition_loader.rb +0 -26
  43. data/lib/event_engine/dsl_compiler.rb +0 -50
  44. data/lib/event_engine/engine.rb +0 -56
  45. data/lib/event_engine/event_definition/inputs.rb +0 -43
  46. data/lib/event_engine/event_definition/payloads.rb +0 -47
  47. data/lib/event_engine/event_definition/schemas.rb +0 -158
  48. data/lib/event_engine/event_definition/validation.rb +0 -18
  49. data/lib/event_engine/event_definition.rb +0 -76
  50. data/lib/event_engine/event_schema_dumper.rb +0 -13
  51. data/lib/event_engine/event_schema_loader.rb +0 -37
  52. data/lib/event_engine/event_schema_merger.rb +0 -62
  53. data/lib/event_engine/event_schema_writer.rb +0 -47
  54. data/lib/event_engine/lifecycle_definition.rb +0 -86
  55. data/lib/event_engine/process_type.rb +0 -26
  56. data/lib/event_engine/reference/guide.md +0 -129
  57. data/lib/event_engine/reference.rb +0 -16
  58. data/lib/event_engine/schema_catalog.rb +0 -50
  59. data/lib/event_engine/schema_compatibility.rb +0 -50
  60. data/lib/event_engine/schema_diff.rb +0 -35
  61. data/lib/event_engine/schema_drift_guard.rb +0 -38
  62. data/lib/event_engine/subject_registry.rb +0 -40
  63. data/lib/event_engine/the_local/agents/event_engine-develop.md +0 -142
  64. data/lib/event_engine/the_local/agents/event_engine-info.md +0 -140
  65. data/lib/event_engine/the_local/agents/event_engine-install.md +0 -140
  66. data/lib/event_engine/the_local.rb +0 -55
  67. data/lib/generators/event_engine/install_generator.rb +0 -31
  68. data/lib/generators/event_engine/templates/event_schema.rb +0 -10
  69. data/lib/generators/event_engine/templates/initializer.rb +0 -4
  70. data/lib/tasks/event_engine_schema.rake +0 -82
  71. data/lib/tasks/event_engine_schema_check.rake +0 -20
  72. data/lib/tasks/event_engine_tasks.rake +0 -4
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: event_engine-install
3
+ description: Use to hook event_engine into a Rails app — adding the gem, writing the `EventEngine.configure` initializer, and getting the boot-time schema catalog in place.
4
+ tools: Bash, Read, Edit
5
+ scope: events — registering processors and publishers, building the schema catalog, and directing emitted events to the right processor
6
+ ---
7
+
8
+ This local follows the steps below exactly, in order, and invents none. Where a
9
+ step names a decision, it asks the developer instead of choosing.
10
+
11
+ ## What event_engine is
12
+
13
+ A Rails engine that loads a committed catalog of event schemas at boot so an app
14
+ can emit checked, routed events — hook it in when an app needs its events to be a
15
+ declared, reviewable contract.
16
+
17
+ ## Interface
18
+
19
+ - `EventEngine.configure` — yields the configuration object. The one setup call a
20
+ host app makes; put it in an initializer so it runs at boot.
21
+
22
+ ## How to use it
23
+
24
+ 1. Add the gem to the host app's `Gemfile`:
25
+
26
+ ```ruby
27
+ gem "event_engine"
28
+ ```
29
+
30
+ Ask the developer whether to take the released gem, pin a version, or track
31
+ the source repository (`github: "DYB-Development/event_engine"`) — do not pick
32
+ for them. The host must be a Rails app; this gem is a Rails engine and does
33
+ nothing outside one.
34
+
35
+ 2. Install it:
36
+
37
+ ```bash
38
+ bundle install
39
+ ```
40
+
41
+ 3. Create `config/initializers/event_engine.rb` in the host app:
42
+
43
+ ```ruby
44
+ require "event_engine"
45
+
46
+ EventEngine.configure do |config|
47
+ end
48
+ ```
49
+
50
+ Every setting is optional — an empty block is a valid install. Steps 4 and 5
51
+ fill it in.
52
+
53
+ 4. Decide `metadata_defaults` with the developer. It takes a callable returning a
54
+ hash, invoked on every emit, and its keys are merged **under** any metadata
55
+ passed at the call site, so the call site wins on a collision. There is no safe
56
+ default: ask what belongs on every event this app emits (request id, actor,
57
+ deploy version, …), and leave it unset if the answer is nothing.
58
+
59
+ ```ruby
60
+ config.metadata_defaults = -> { { request_id: Current.request_id } }
61
+ ```
62
+
63
+ A callable that raises is swallowed and logged rather than breaking the emit.
64
+
65
+ 5. Set `logger` only if the engine's own output should go somewhere other than
66
+ `Rails.logger` — it defaults to `Rails.logger` inside a Rails app.
67
+
68
+ ```ruby
69
+ config.logger = Logger.new("log/event_engine.log")
70
+ ```
71
+
72
+ 6. Get the schema catalog to `db/event_schema.json` in the host app and commit it.
73
+ The engine reads that exact path at boot; the path is fixed and no setting
74
+ moves it. Without the file, the app logs a warning in `development` and `test`
75
+ and **refuses to boot in every other environment**. Building the catalog from
76
+ the app's event packs is the `event_engine-develop` local's job — hand off to
77
+ it, and confirm the file exists before treating this install as done.
78
+
79
+ 7. Verify the app boots with the catalog loaded:
80
+
81
+ ```bash
82
+ bin/rails runner 'puts EventEngine.schema_registry.loaded?'
83
+ ```
84
+
85
+ `true` means the initializer ran and the catalog was read. `false` means the
86
+ catalog file is missing — go back to step 6.
87
+
88
+ ## Conventions
89
+
90
+ - The initializer is the only host file this local writes, plus one `Gemfile`
91
+ line. It creates no migrations and no tables.
92
+ - Re-running any step is safe. Editing the initializer requires an app restart to
93
+ take effect; nothing re-reads it at runtime.
94
+ - If `db/event_engine_helpers.rb` is present in the host app, the engine loads it
95
+ at boot. It never creates that file — an event pack commits it. Do not write one.
96
+ - Out of scope for this local: everything an app does *with* the engine —
97
+ registering processors, publishers or handlers, choosing how events route,
98
+ pointing the engine at schema sources, emitting events, and the catalog tasks.
99
+ All of that belongs to `event_engine-develop`.
@@ -0,0 +1,27 @@
1
+ scope: events — registering processors and publishers, building the schema catalog, and directing emitted events to the right processor
2
+
3
+ install:
4
+ - EventEngine.configure
5
+
6
+ develop:
7
+ - EventEngine.register_processor
8
+ - EventEngine.register_definition_publisher!
9
+ - EventEngine.register_handler
10
+ - publisher_schema_paths
11
+ - event_processors
12
+ - domain_processors
13
+ - default_processor
14
+ - bin/rails event_engine:schema:catalog
15
+ - bin/rails event_engine:catalog
16
+
17
+ sources:
18
+ - lib/event_engine.rb
19
+ - lib/event_engine/engine.rb
20
+ - lib/event_engine/configuration.rb
21
+ - lib/event_engine/definition_publisher.rb
22
+ - lib/event_engine/processor_registry.rb
23
+ - lib/event_engine/processor_resolver.rb
24
+ - lib/event_engine/handler_registry.rb
25
+ - lib/event_engine/schema_catalog_builder.rb
26
+ - lib/tasks/event_engine_catalog.rake
27
+ - lib/tasks/event_engine_schema_catalog.rake
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: event_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-25 00:00:00.000000000 Z
11
+ date: 2026-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: railties
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -30,10 +30,30 @@ dependencies:
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '9'
33
- description: 'The core of the EventEngine pipeline: define events with a Ruby DSL,
34
- compile to a canonical schema, and dispatch built events to registered handlers
35
- by level. Durable delivery, transports, the outbox, and the observability dashboard
36
- live in the companion gem event_engine-delivery.'
33
+ - !ruby/object:Gem::Dependency
34
+ name: activesupport
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 7.1.6
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '9'
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 7.1.6
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '9'
53
+ description: 'The runtime of the EventEngine pipeline: load the committed schema catalog
54
+ aggregated from domain packs, build validated events, and dispatch them to registered
55
+ handlers by process_type. Events are declared with event_engine-event_definition;
56
+ durable delivery, transports, and the dashboard live in event_engine-delivery.'
37
57
  email:
38
58
  - tylercschneider@gmail.com
39
59
  executables: []
@@ -44,56 +64,33 @@ files:
44
64
  - MIT-LICENSE
45
65
  - README.md
46
66
  - Rakefile
47
- - app/assets/config/event_engine_manifest.js
48
- - app/assets/stylesheets/event_engine/application.css
49
- - app/controllers/event_engine/application_controller.rb
50
- - app/helpers/event_engine/application_helper.rb
51
- - app/jobs/event_engine/application_job.rb
52
- - app/mailers/event_engine/application_mailer.rb
53
- - app/models/event_engine/application_record.rb
54
- - app/views/layouts/event_engine/application.html.erb
55
- - config/routes.rb
56
67
  - lib/event_engine.rb
68
+ - lib/event_engine/catalog_entry.rb
57
69
  - lib/event_engine/configuration.rb
58
- - lib/event_engine/definition_loader.rb
59
- - lib/event_engine/dsl_compiler.rb
60
- - lib/event_engine/engine.rb
70
+ - lib/event_engine/definition_publisher.rb
61
71
  - lib/event_engine/event.rb
62
72
  - lib/event_engine/event_builder.rb
63
- - lib/event_engine/event_definition.rb
64
- - lib/event_engine/event_definition/inputs.rb
65
- - lib/event_engine/event_definition/payloads.rb
66
- - lib/event_engine/event_definition/schemas.rb
67
- - lib/event_engine/event_definition/validation.rb
68
73
  - lib/event_engine/event_schema.rb
69
- - lib/event_engine/event_schema_dumper.rb
70
- - lib/event_engine/event_schema_loader.rb
71
- - lib/event_engine/event_schema_merger.rb
72
- - lib/event_engine/event_schema_writer.rb
74
+ - lib/event_engine/event_schema_json_loader.rb
73
75
  - lib/event_engine/handler_registry.rb
74
- - lib/event_engine/lifecycle_definition.rb
75
- - lib/event_engine/process_type.rb
76
+ - lib/event_engine/invalid_rules_error.rb
77
+ - lib/event_engine/processing_rules.rb
78
+ - lib/event_engine/processor_registry.rb
79
+ - lib/event_engine/processor_resolver.rb
76
80
  - lib/event_engine/railtie.rb
77
- - lib/event_engine/reference.rb
78
- - lib/event_engine/reference/guide.md
79
- - lib/event_engine/schema_catalog.rb
80
- - lib/event_engine/schema_compatibility.rb
81
- - lib/event_engine/schema_diff.rb
82
- - lib/event_engine/schema_drift_guard.rb
81
+ - lib/event_engine/rules_file.rb
82
+ - lib/event_engine/schema_catalog_builder.rb
83
83
  - lib/event_engine/schema_registry.rb
84
- - lib/event_engine/subject_registry.rb
85
- - lib/event_engine/the_local.rb
86
- - lib/event_engine/the_local/agents/event_engine-develop.md
87
- - lib/event_engine/the_local/agents/event_engine-info.md
88
- - lib/event_engine/the_local/agents/event_engine-install.md
84
+ - lib/event_engine/unregistered_processor_error.rb
85
+ - lib/event_engine/unroutable_event_error.rb
86
+ - lib/event_engine/unrouted_events_error.rb
89
87
  - lib/event_engine/version.rb
90
- - lib/generators/event_engine/install_generator.rb
91
- - lib/generators/event_engine/templates/event_schema.rb
92
- - lib/generators/event_engine/templates/initializer.rb
93
88
  - lib/tasks/event_engine_catalog.rake
94
- - lib/tasks/event_engine_schema.rake
95
- - lib/tasks/event_engine_schema_check.rake
96
- - lib/tasks/event_engine_tasks.rake
89
+ - lib/tasks/event_engine_rules.rake
90
+ - the_local/agents/event_engine-develop.md
91
+ - the_local/agents/event_engine-info.md
92
+ - the_local/agents/event_engine-install.md
93
+ - the_local/interface.yml
97
94
  homepage: https://eventengine.co
98
95
  licenses:
99
96
  - MIT
@@ -123,5 +120,5 @@ requirements: []
123
120
  rubygems_version: 3.5.16
124
121
  signing_key:
125
122
  specification_version: 4
126
- summary: Schema-first event definitions and dispatch for Rails
123
+ summary: The Rails host runtime for the schema-first EventEngine pipeline
127
124
  test_files: []
@@ -1 +0,0 @@
1
- //= link_directory ../stylesheets/event_engine .css
@@ -1,15 +0,0 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
- * files in this directory. Styles in this file should be added after the last require_* statement.
11
- * It is generally better to create a new file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
@@ -1,4 +0,0 @@
1
- module EventEngine
2
- class ApplicationController < ActionController::Base
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module EventEngine
2
- module ApplicationHelper
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module EventEngine
2
- class ApplicationJob < ActiveJob::Base
3
- end
4
- end
@@ -1,6 +0,0 @@
1
- module EventEngine
2
- class ApplicationMailer < ActionMailer::Base
3
- default from: "from@example.com"
4
- layout "mailer"
5
- end
6
- end
@@ -1,5 +0,0 @@
1
- module EventEngine
2
- class ApplicationRecord < ActiveRecord::Base
3
- self.abstract_class = true
4
- end
5
- end
@@ -1,15 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Event engine</title>
5
- <%= csrf_meta_tags %>
6
- <%= csp_meta_tag %>
7
-
8
- <%= stylesheet_link_tag "event_engine/application", media: "all" %>
9
- </head>
10
- <body>
11
-
12
- <%= yield %>
13
-
14
- </body>
15
- </html>
data/config/routes.rb DELETED
@@ -1,2 +0,0 @@
1
- EventEngine::Engine.routes.draw do
2
- end
@@ -1,26 +0,0 @@
1
- module EventEngine
2
- module DefinitionLoader
3
- class << self
4
- def ensure_loaded!
5
- eager_load_definitions!
6
- LifecycleDefinition.materialize_all!
7
- end
8
-
9
- def eager_load_definitions!
10
- return if loaded?
11
-
12
- unless defined?(Rails) && Rails.application
13
- raise "EventEngine requires a Rails application to load definitions"
14
- end
15
-
16
- Rails.application.eager_load!
17
-
18
- @loaded = true
19
- end
20
-
21
- def loaded?
22
- @loaded ||= false
23
- end
24
- end
25
- end
26
- end
@@ -1,50 +0,0 @@
1
- module EventEngine
2
- class DslCompiler
3
- class InvalidEventNameError < StandardError; end
4
-
5
- SNAKE_CASE = /\A[a-z][a-z0-9_]*\z/
6
-
7
- def self.compile(definitions)
8
- registry = SchemaRegistry.new
9
- subject_violations = []
10
- name_violations = []
11
-
12
- Array(definitions).each do |definition|
13
- schema = definition.schema
14
- record_subject_violation(schema, subject_violations)
15
- record_name_violation(schema, name_violations)
16
- registry.register(schema)
17
- end
18
-
19
- raise_invalid_event_names(name_violations)
20
- raise_unknown_subjects(subject_violations)
21
-
22
- registry
23
- end
24
-
25
- def self.record_name_violation(schema, violations)
26
- return if schema.event_name.to_s.match?(SNAKE_CASE)
27
-
28
- violations << schema.event_name.inspect
29
- end
30
-
31
- def self.raise_invalid_event_names(violations)
32
- return if violations.empty?
33
-
34
- raise InvalidEventNameError, "event names must be snake_case: #{violations.join(", ")}"
35
- end
36
-
37
- def self.record_subject_violation(schema, violations)
38
- return if schema.subject.nil?
39
- return if EventEngine.subject_registry.registered?(schema.subject)
40
-
41
- violations << "#{schema.event_name}: unknown subject #{schema.subject.inspect}"
42
- end
43
-
44
- def self.raise_unknown_subjects(violations)
45
- return if violations.empty?
46
-
47
- raise SubjectRegistry::UnknownSubjectError, violations.join(", ")
48
- end
49
- end
50
- end
@@ -1,56 +0,0 @@
1
- module EventEngine
2
- class Engine < ::Rails::Engine
3
- isolate_namespace EventEngine
4
-
5
- initializer "event_engine.load_schema_and_install_helpers" do |app|
6
- app.config.after_initialize do
7
- schema_path = Rails.root.join("db", "event_schema.rb")
8
-
9
- if File.exist?(schema_path)
10
- Engine.send(
11
- :load_schema_and_install_helpers,
12
- schema_path: schema_path
13
- )
14
- else
15
- Engine.send(
16
- :handle_missing_schema!,
17
- schema_path
18
- )
19
- end
20
- end
21
- end
22
-
23
- class << self
24
- private
25
-
26
- def load_schema_and_install_helpers(schema_path:)
27
- EventEngine.boot_from_schema!(
28
- schema_path: schema_path,
29
- registry: EventEngine::SchemaRegistry.new
30
- )
31
- end
32
-
33
- def handle_missing_schema!(schema_path)
34
- if Rails.env.development? || Rails.env.test?
35
- Rails.logger.warn(
36
- "[EventEngine] Schema file not found at #{schema_path}. " \
37
- "Run: bin/rails event_engine:schema:dump"
38
- )
39
- return
40
- end
41
-
42
- raise <<~MSG
43
- EventEngine schema file missing.
44
-
45
- Expected to find:
46
- #{schema_path}
47
-
48
- Run:
49
- bin/rails event_engine:schema:dump
50
-
51
- And commit the generated file.
52
- MSG
53
- end
54
- end
55
- end
56
- end
@@ -1,43 +0,0 @@
1
- module EventEngine
2
- class EventDefinition
3
- # DSL methods for declaring required and optional inputs on an event definition.
4
- module Inputs
5
- def self.included(base)
6
- base.extend ClassMethods
7
- end
8
-
9
- module ClassMethods
10
- # Declares a required input for this event.
11
- #
12
- # @param name [Symbol] the input name
13
- # @raise [ArgumentError] if the input is already declared
14
- def input(name)
15
- name = name.to_sym
16
- if inputs.key?(name)
17
- raise ArgumentError, "duplicate input: #{name}"
18
- end
19
- inputs[name] = :required
20
- end
21
-
22
- # Declares an optional input for this event.
23
- #
24
- # @param name [Symbol] the input name
25
- # @raise [ArgumentError] if the input is already declared
26
- def optional_input(name)
27
- name = name.to_sym
28
- if inputs.key?(name)
29
- raise ArgumentError, "duplicate input: #{name}"
30
- end
31
- inputs[name] = :optional
32
- end
33
-
34
- # Returns all declared inputs as a hash of name => :required/:optional.
35
- #
36
- # @return [Hash{Symbol => Symbol}]
37
- def inputs
38
- @inputs ||= {}
39
- end
40
- end
41
- end
42
- end
43
- end
@@ -1,47 +0,0 @@
1
- module EventEngine
2
- class EventDefinition
3
- # DSL methods for declaring payload fields on an event definition.
4
- module Payloads
5
- def self.included(base)
6
- base.extend ClassMethods
7
- end
8
-
9
- module ClassMethods
10
- # Declares an optional payload field.
11
- #
12
- # @param name [Symbol] the field name in the event payload
13
- # @param from [Symbol] the input to extract the value from
14
- # @param attr [Symbol, nil] method to call on the input (nil for passthrough)
15
- def optional_payload(name, from: nil, attr: nil)
16
- payload_fields << {
17
- name: name.to_sym,
18
- required: false,
19
- from: from,
20
- attr: attr
21
- }
22
- end
23
-
24
- # Declares a required payload field.
25
- #
26
- # @param name [Symbol] the field name in the event payload
27
- # @param from [Symbol] the input to extract the value from
28
- # @param attr [Symbol, nil] method to call on the input (nil for passthrough)
29
- def required_payload(name, from: nil, attr: nil)
30
- payload_fields << {
31
- name: name.to_sym,
32
- required: true,
33
- from: from,
34
- attr: attr
35
- }
36
- end
37
-
38
- # Returns all declared payload field definitions.
39
- #
40
- # @return [Array<Hash>]
41
- def payload_fields
42
- @payload_fields ||= []
43
- end
44
- end
45
- end
46
- end
47
- end