Class: Rooibos::Configuration
- Inherits:
-
Object
- Object
- Rooibos::Configuration
- Defined in:
- lib/rooibos/configuration.rb
Overview
Configuration represents the Mealy machine (state, input) pair. Immutable value object; use with_model to derive new configurations.
Instance Method Summary collapse
-
#to_a ⇒ Object
(also: #to_ary, #deconstruct)
Destructures into
[message, model]array. -
#with_model(new_model) ⇒ Object
Derives a new Configuration with an updated model.
Instance Method Details
#to_a ⇒ Object Also known as: to_ary, deconstruct
Destructures into [message, model] array.
23 24 25 |
# File 'lib/rooibos/configuration.rb', line 23 def to_a [, model] end |
#with_model(new_model) ⇒ Object
Derives a new Configuration with an updated model. Returns self if new_model is nil.
15 16 17 18 19 |
# File 'lib/rooibos/configuration.rb', line 15 def with_model(new_model) return self unless new_model Configuration.new(message:, model: new_model) end |