Class: Core::Boundary::Normalizer

Inherits:
Object
  • Object
show all
Includes:
Inspect
Defined in:
lib/core/boundary/normalizer.rb

Overview

public

Instance Method Summary collapse

Constructor Details

#initializeNormalizer

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_copyObject



19
20
21
22
23
# File 'lib/core/boundary/normalizer.rb', line 19

def initialize_copy(...)
  @actions = @actions.copy

  super
end