Class: Textus::Action::Base
- Inherits:
-
Object
- Object
- Textus::Action::Base
show all
- Extended by:
- Contract::DSL
- Defined in:
- lib/textus/action/base.rb
Direct Known Subclasses
Accept, Audit, Blame, Boot, DataMv, Deps, Doctor, Drain, Enqueue, Get, Ingest, Jobs, KeyDelete, KeyDeletePrefix, KeyMv, KeyMvPrefix, List, Propose, Published, Pulse, Put, Rdeps, Reject, RuleExplain, RuleLint, RuleList, SchemaEnvelope, Uid, Where
Class Method Summary
collapse
arg, cli, cli_stdin, contract, contract?, summary, surfaces, verb, view
Class Method Details
.call ⇒ Object
31
32
33
|
# File 'lib/textus/action/base.rb', line 31
def self.call(**)
raise NotImplementedError.new("#{name}.call")
end
|
.inherited(subclass) ⇒ Object
26
27
28
29
|
# File 'lib/textus/action/base.rb', line 26
def self.inherited(subclass)
super
Textus::Action.register(subclass) if subclass.name
end
|
.proposal_from(env, key:) ⇒ Object
35
36
37
38
39
|
# File 'lib/textus/action/base.rb', line 35
def self.proposal_from(env, key:)
proposal = env.meta&.dig("proposal") or return Failure(code: :proposal_error, message: "entry has no proposal block: #{key}")
target = proposal["target_key"] or return Failure(code: :proposal_error, message: "proposal missing target_key")
{ proposal:, target_key: target }
end
|