Class: Rohbau::Interface
Defined Under Namespace
Classes: Caller
Instance Method Summary
collapse
clear, for
Constructor Details
Returns a new instance of Interface.
10
11
12
13
14
15
|
# File 'lib/rohbau/interface.rb', line 10
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
75
76
77
78
79
|
# File 'lib/rohbau/interface.rb', line 75
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
32
33
34
|
# File 'lib/rohbau/interface.rb', line 32
def call_count
@call_count
end
|
#calls ⇒ Object
28
29
30
|
# File 'lib/rohbau/interface.rb', line 28
def calls
@calls
end
|
#clear_cached_requests ⇒ Object
24
25
26
|
# File 'lib/rohbau/interface.rb', line 24
def clear_cached_requests
RequestCache.clear
end
|
#clear_stubs ⇒ Object
17
18
19
20
21
22
|
# File 'lib/rohbau/interface.rb', line 17
def clear_stubs
calls.clear
call_count.clear
stub_results.clear
stub_type_for.clear
end
|