Class: Callapi::Call::Request::Mock
- Inherits:
-
Base
- Object
- Base
- Callapi::Call::Request::Mock
show all
- Extended by:
- Memoist
- Defined in:
- lib/callapi/call/request/mock.rb
Constant Summary
collapse
- MOCK_FORMAT =
TODO: should not be hardcoded
'.json'
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#body ⇒ Object
14
15
16
17
18
|
# File 'lib/callapi/call/request/mock.rb', line 14
def body
File.read(file_path)
rescue Errno::ENOENT
raise Callapi::CouldNotFoundMockRequestFileError.new(file_path)
end
|
#code ⇒ Object
10
11
12
|
# File 'lib/callapi/call/request/mock.rb', line 10
def code
'200'
end
|
#response ⇒ Object
6
7
8
|
# File 'lib/callapi/call/request/mock.rb', line 6
def response
OpenStruct.new(body: body, code: code)
end
|