Class: Hecks::Bluebook::Command

Inherits:
Object
  • Object
show all
Extended by:
Behaviour::Command, Construct, IR
Defined in:
lib/hecks/bluebook/command.rb

Overview

A command, as a RUBY CLASS.

NOT nested as a constant, and that is a finding rather than a shortcut. A command and a value object may legitimately share a name inside one aggregate — the language does it six times, and means it: the command Argument is the verb that appends to the arguments list whose element type is the value object Argument, and Plan reads exactly that pairing. So Bluebook::Command::Argument cannot be both, and a single constant namespace cannot index a kind-ambiguous name. The same follows for hecks_fqn : Bluebook::Command.Argument names both, which is why the judge's ids only work per-category, each in its own repository. IDENTITY IS (KIND, FQN), not fqn.

It is a declaration holder anyway, because that is where the EDGES live. acts_on answers with the owning construct itself — the Aggregate, or the entity holder for a piece's verb — rather than the name of one. The invocation door (pizza.add_topping) is the facade's business, a per-boot projection ; no verb method is defined here.

Class Attribute Summary collapse

Attributes included from Construct

#hecks_name, #hecks_owner, #hecks_root

Class Method Summary collapse

Methods included from Construct

hecks_fqn, hecks_root?, hecks_separator

Methods included from IR

extended, included

Methods included from Behaviour::Command

acts_on, addressing_key_for, creates?, guard_descriptions, settle

Methods included from Behaviour::Indexed

#attribute, #command, #index_attributes, #index_by_hecks_name, #query

Class Attribute Details

.attributesObject (readonly)

Returns the value of attribute attributes.



94
95
96
# File 'lib/hecks/bluebook/command.rb', line 94

def attributes
  @attributes
end

.emitsObject (readonly)

Returns the value of attribute emits.



94
95
96
# File 'lib/hecks/bluebook/command.rb', line 94

def emits
  @emits
end

.ensuresObject (readonly)

Returns the value of attribute ensures.



94
95
96
# File 'lib/hecks/bluebook/command.rb', line 94

def ensures
  @ensures
end

.fromObject (readonly)

Returns the value of attribute from.



94
95
96
# File 'lib/hecks/bluebook/command.rb', line 94

def from
  @from
end

.givensObject (readonly)

Returns the value of attribute givens.



94
95
96
# File 'lib/hecks/bluebook/command.rb', line 94

def givens
  @givens
end

.goalObject (readonly)

Returns the value of attribute goal.



94
95
96
# File 'lib/hecks/bluebook/command.rb', line 94

def goal
  @goal
end

.mutationsObject (readonly)

Returns the value of attribute mutations.



94
95
96
# File 'lib/hecks/bluebook/command.rb', line 94

def mutations
  @mutations
end

.provenanceObject (readonly)

Returns the value of attribute provenance.



94
95
96
# File 'lib/hecks/bluebook/command.rb', line 94

def provenance
  @provenance
end

.referencesObject (readonly)

Returns the value of attribute references.



94
95
96
# File 'lib/hecks/bluebook/command.rb', line 94

def references
  @references
end

.roleObject (readonly)

Returns the value of attribute role.



94
95
96
# File 'lib/hecks/bluebook/command.rb', line 94

def role
  @role
end

Class Method Details

.absorb(role:, goal:, attributes:, givens:, ensures:, mutations:, emits:, references:, from: nil, provenance: nil) ⇒ Object



107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/hecks/bluebook/command.rb', line 107

def absorb(role:, goal:, attributes:, givens:, ensures:, mutations:, emits:, references:,
           from: nil, provenance: nil)
  @role       = role
  @goal       = goal
  @attributes = attributes
  @givens     = givens
  @ensures    = ensures
  @mutations  = mutations
  @emits      = emits
  @references = references
  @from       = from
  @provenance = provenance
  settle
end

.declare(name:, role: nil, goal: nil, attributes: [], givens: [], ensures: [], mutations: [], emits: [], references: nil, from: nil, provenance: nil) ⇒ Object



97
98
99
100
101
102
103
104
105
# File 'lib/hecks/bluebook/command.rb', line 97

def declare(name:, role: nil, goal: nil, attributes: [], givens: [], ensures: [],
            mutations: [], emits: [], references: nil, from: nil, provenance: nil)
  verb = Class.new(self)
  verb.hecks_name = name.to_s
  verb.absorb(role: role, goal: goal, attributes: attributes, givens: givens,
              ensures: ensures, mutations: mutations, emits: emits, references: references&.to_s,
              from: from, provenance: provenance)
  verb
end