Class: Rohbau::Interface
Defined Under Namespace
Classes: Caller
Instance Method Summary
collapse
clear, for
Constructor Details
Returns a new instance of Interface.
7
8
9
10
11
12
|
# File 'lib/rohbau/interface.rb', line 7
def initialize
@calls = Hash.new { |h, k| h[k] = nil }
@call_count = Hash.new { |h, k| h[k] = 0 }
@stub_results = Hash.new { |h, k| h[k] = nil }
@stub_type_for = Hash.new { |h, k| h[k] = nil }
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(domain, *args) ⇒ Object
72
73
74
75
76
|
# File 'lib/rohbau/interface.rb', line 72
def method_missing(domain, *args)
use_case = args[0]
input = args[1] || {}
call_use_case(domain, use_case, input)
end
|
Instance Method Details
#call_count ⇒ Object
29
30
31
|
# File 'lib/rohbau/interface.rb', line 29
def call_count
@call_count
end
|
#calls ⇒ Object
25
26
27
|
# File 'lib/rohbau/interface.rb', line 25
def calls
@calls
end
|
#clear_cached_requests ⇒ Object
21
22
23
|
# File 'lib/rohbau/interface.rb', line 21
def clear_cached_requests
RequestCache.clear
end
|
#clear_stubs ⇒ Object
14
15
16
17
18
19
|
# File 'lib/rohbau/interface.rb', line 14
def clear_stubs
calls.clear
call_count.clear
stub_results.clear
stub_type_for.clear
end
|