Class: Dialers::MockedResponse
- Inherits:
-
Object
- Object
- Dialers::MockedResponse
- Defined in:
- lib/dialers/mockable_caller.rb
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(http_method: nil, url: "", params: {}, headers: {}, routes_definition: nil) ⇒ MockedResponse
constructor
A new instance of MockedResponse.
- #status ⇒ Object
Constructor Details
#initialize(http_method: nil, url: "", params: {}, headers: {}, routes_definition: nil) ⇒ MockedResponse
Returns a new instance of MockedResponse.
59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/dialers/mockable_caller.rb', line 59 def initialize(http_method: nil, url: "", params: {}, headers: {}, routes_definition: nil) self.http_method = http_method self.url = url self.params = params self.headers = headers self.route = routes_definition.get_route(http_method, url) if route.nil? fail "Route is not defined for: #{http_method} to #{url}." end end |
Instance Method Details
#body ⇒ Object
75 76 77 |
# File 'lib/dialers/mockable_caller.rb', line 75 def body route[:body] end |
#status ⇒ Object
71 72 73 |
# File 'lib/dialers/mockable_caller.rb', line 71 def status route[:status] end |