Module: ServiceActor::Defaultable::PrependedMethods

Defined in:
lib/service_actor/defaultable.rb

Instance Method Summary collapse

Instance Method Details

#_callObject

rubocop:disable Metrics/MethodLength



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/service_actor/defaultable.rb', line 20

def _call # rubocop:disable Metrics/MethodLength
  self.class.inputs.each do |key, input|
    next if result.key?(key)

    unless input.key?(:default)
      raise_error_with(
        "The \"#{key}\" input on \"#{self.class}\" is missing",
      )
    end

    apply_default_for_origin(key, input)
  end

  self.class.outputs.each do |key, output|
    next if result.key?(key)

    apply_default_for_origin(key, output)
  end

  super
end