Class: Core::Boundary::Normalizer
- Inherits:
-
Object
- Object
- Core::Boundary::Normalizer
- Includes:
- Inspect
- Defined in:
- lib/core/boundary/normalizer.rb
Overview
- public
Instance Method Summary collapse
-
#action(&block) ⇒ Object
[public].
-
#call(value) ⇒ Object
[public].
-
#initialize ⇒ Normalizer
constructor
A new instance of Normalizer.
- #initialize_copy ⇒ Object
Constructor Details
#initialize ⇒ Normalizer
Returns a new instance of Normalizer.
15 16 17 |
# File 'lib/core/boundary/normalizer.rb', line 15 def initialize @actions = [] end |
Instance Method Details
#action(&block) ⇒ Object
- public
27 28 29 |
# File 'lib/core/boundary/normalizer.rb', line 27 def action(&block) @actions << block end |
#call(value) ⇒ Object
- public
33 34 35 36 37 |
# File 'lib/core/boundary/normalizer.rb', line 33 def call(value) @actions.inject(value) { |current, action| action.call(current) } end |
#initialize_copy ⇒ Object
19 20 21 22 23 |
# File 'lib/core/boundary/normalizer.rb', line 19 def initialize_copy(...) @actions = @actions.copy super end |