Class: Rohbau::Interface::Caller

Inherits:
Object
  • Object
show all
Defined in:
lib/rohbau/interface.rb

Instance Method Summary collapse

Constructor Details

#initialize(domain) ⇒ Caller

Returns a new instance of Caller.



79
80
81
# File 'lib/rohbau/interface.rb', line 79

def initialize(domain)
  @domain = validate_and_return!(domain)
end

Instance Method Details

#call(use_case, args, options = {}) ⇒ Object



83
84
85
86
87
88
89
90
91
92
93
# File 'lib/rohbau/interface.rb', line 83

def call(use_case, args, options = {})
  type = options[:stub_type]
  stubbed_result = options[:stub_result]
  use_case = get_use_case_for(use_case, args)

  if stubbed_result
    stub_use_case(use_case, type, stubbed_result)
  else
    call_use_case(use_case, args)
  end
end