Class: Textus::Action::RuleExplain

Inherits:
Base
  • Object
show all
Extended by:
Contract::DSL
Defined in:
lib/textus/action/rule_explain.rb

Constant Summary collapse

BURN =
:sync
REGISTRY =
Textus::Manifest::Schema::FIELD_REGISTRY
LEAN_FIELDS =
REGISTRY.select { |_, m| m[:in_rule_explain].include?(:lean) }.keys.freeze
DETAIL_FIELDS =
REGISTRY.select { |_, m| m[:in_rule_explain].include?(:detail) }.keys.freeze
EFFECTIVE_FIELDS =
DETAIL_FIELDS.select { |f| REGISTRY[f][:policy_class] }.freeze

Instance Method Summary collapse

Methods included from Contract::DSL

arg, around, cli, cli_stdin, contract, contract?, summary, surfaces, verb, view

Methods inherited from Base

#args, inherited

Constructor Details

#initialize(key:, detail: nil) ⇒ RuleExplain

Returns a new instance of RuleExplain.



20
21
22
23
24
# File 'lib/textus/action/rule_explain.rb', line 20

def initialize(key:, detail: nil)
  super()
  @key = key
  @detail = detail
end

Instance Method Details

#call(container:) ⇒ Object



26
27
28
29
# File 'lib/textus/action/rule_explain.rb', line 26

def call(container:, **)
  @manifest = container.manifest
  @detail ? explain(@key) : effective(@key)
end