Class: FakeRest::UserRequest
- Inherits:
-
Object
- Object
- FakeRest::UserRequest
- Defined in:
- lib/fakerest/userrequests.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#request_file_path ⇒ Object
readonly
Returns the value of attribute request_file_path.
-
#request_file_type ⇒ Object
readonly
Returns the value of attribute request_file_type.
-
#response_status_code ⇒ Object
readonly
Returns the value of attribute response_status_code.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(method, url, body, response_status_code, params = {}, request_file_path = "", request_file_type = "") ⇒ UserRequest
constructor
A new instance of UserRequest.
- #to_json(*ur) ⇒ Object
Constructor Details
#initialize(method, url, body, response_status_code, params = {}, request_file_path = "", request_file_type = "") ⇒ UserRequest
Returns a new instance of UserRequest.
6 7 8 9 10 11 12 13 14 |
# File 'lib/fakerest/userrequests.rb', line 6 def initialize(method, url, body, response_status_code, params = {}, request_file_path = "", request_file_type = "") @method = method @url = url @body = body @params = params @response_status_code = response_status_code @request_file_path = request_file_path @request_file_type = request_file_type end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/fakerest/userrequests.rb', line 5 def body @body end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
5 6 7 |
# File 'lib/fakerest/userrequests.rb', line 5 def method @method end |
#request_file_path ⇒ Object (readonly)
Returns the value of attribute request_file_path.
5 6 7 |
# File 'lib/fakerest/userrequests.rb', line 5 def request_file_path @request_file_path end |
#request_file_type ⇒ Object (readonly)
Returns the value of attribute request_file_type.
5 6 7 |
# File 'lib/fakerest/userrequests.rb', line 5 def request_file_type @request_file_type end |
#response_status_code ⇒ Object (readonly)
Returns the value of attribute response_status_code.
5 6 7 |
# File 'lib/fakerest/userrequests.rb', line 5 def response_status_code @response_status_code end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/fakerest/userrequests.rb', line 5 def url @url end |
Instance Method Details
#to_json(*ur) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/fakerest/userrequests.rb', line 16 def to_json(*ur) { "method" => @method, "url" => @url, "body" => @body, "params" => @params.reject {|key,value| key == 'file' or key == 'splat' or key == 'captures' or key == 'outvar' or key =='default_encoding' } }.to_json(*ur) end |