discourse/lib/service/policy_base.rb
Loïc Guitaut 6759ad71ca
DEV: Extract step classes from Service::Base into individual files (#37956)
The `base.rb` file (640+ lines) contained 9 step classes, the `Context`
class, and the `StepsHelpers` DSL module alongside the core concern.
Each is now in its own file under `lib/service/base/`, following the
existing `lib/service.rb` + `lib/service/*.rb` pattern.

Also:
- Update stale inline documentation in `lib/service.rb`
- Use `NotImplementedError` instead of generic raise in `PolicyBase` and
`ActionBase`
- Move YARD DSL docs to a `@!parse` block at the top of `base.rb`
2026-02-23 09:49:37 +01:00

19 lines
274 B
Ruby

# frozen_string_literal: true
class Service::PolicyBase
attr_reader :context
delegate :guardian, to: :context
def initialize(context)
@context = context
end
def call
raise NotImplementedError
end
def reason
raise NotImplementedError
end
end