Class: Hecks::Bluebook::Translation
- Inherits:
-
Object
- Object
- Hecks::Bluebook::Translation
- Defined in:
- lib/hecks/bluebook/translation.rb
Overview
A declared map from one era of a domain's storage shape to the
next. Renames and moves — the smallest slice that proves the
concept: old records are translated when they are replayed, never
rewritten. retired acknowledges aggregates that are gone
outright — not renamed — so their disappearance is a decision,
not an accident.
Instance Attribute Summary collapse
-
#aggregates ⇒ Object
readonly
Returns the value of attribute aggregates.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#retired ⇒ Object
readonly
Returns the value of attribute retired.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
- #for_aggregate(name) ⇒ Object
-
#initialize(domain:, from:, to:, aggregates: [], retired: []) ⇒ Translation
constructor
A new instance of Translation.
Constructor Details
#initialize(domain:, from:, to:, aggregates: [], retired: []) ⇒ Translation
Returns a new instance of Translation.
81 82 83 84 85 86 87 |
# File 'lib/hecks/bluebook/translation.rb', line 81 def initialize(domain:, from:, to:, aggregates: [], retired: []) @domain = domain.to_s @from = from @to = to @aggregates = aggregates @retired = retired end |
Instance Attribute Details
#aggregates ⇒ Object (readonly)
Returns the value of attribute aggregates.
79 80 81 |
# File 'lib/hecks/bluebook/translation.rb', line 79 def aggregates @aggregates end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
79 80 81 |
# File 'lib/hecks/bluebook/translation.rb', line 79 def domain @domain end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
79 80 81 |
# File 'lib/hecks/bluebook/translation.rb', line 79 def from @from end |
#retired ⇒ Object (readonly)
Returns the value of attribute retired.
79 80 81 |
# File 'lib/hecks/bluebook/translation.rb', line 79 def retired @retired end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
79 80 81 |
# File 'lib/hecks/bluebook/translation.rb', line 79 def to @to end |
Instance Method Details
#for_aggregate(name) ⇒ Object
89 |
# File 'lib/hecks/bluebook/translation.rb', line 89 def for_aggregate(name) = @aggregates.find { |aggregate| aggregate.name == name.to_s } |