Class: Fitting::Records::Tested::Request
- Inherits:
-
Object
- Object
- Fitting::Records::Tested::Request
- Defined in:
- lib/fitting/records/tested/request.rb
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(env_response, test_title) ⇒ Request
constructor
A new instance of Request.
- #method ⇒ Object
- #path ⇒ Object
- #response ⇒ Object
- #test_file_path ⇒ Object
- #test_path ⇒ Object
- #to_spherical ⇒ Object
Constructor Details
#initialize(env_response, test_title) ⇒ Request
Returns a new instance of Request.
9 10 11 12 |
# File 'lib/fitting/records/tested/request.rb', line 9 def initialize(env_response, test_title) @env_response = env_response @test_title = test_title end |
Instance Method Details
#body ⇒ Object
22 23 24 |
# File 'lib/fitting/records/tested/request.rb', line 22 def body @body ||= @env_response.request.env['action_dispatch.request.request_parameters'] end |
#method ⇒ Object
14 15 16 |
# File 'lib/fitting/records/tested/request.rb', line 14 def method @method ||= @env_response.request.request_method end |
#path ⇒ Object
18 19 20 |
# File 'lib/fitting/records/tested/request.rb', line 18 def path @path ||= Tomograph::Path.new(@env_response.request.env['PATH_INFO'] || @env_response.request.fullpath) end |
#response ⇒ Object
26 27 28 |
# File 'lib/fitting/records/tested/request.rb', line 26 def response @response ||= Fitting::Records::Tested::Response.new(@env_response) end |
#test_file_path ⇒ Object
34 35 36 |
# File 'lib/fitting/records/tested/request.rb', line 34 def test_file_path @test_file_path ||= test_path.split(':').first end |
#test_path ⇒ Object
30 31 32 |
# File 'lib/fitting/records/tested/request.rb', line 30 def test_path @test_path ||= @test_title[/#{'\(\.'}(.*?)#{'\)'}/m, 1] || @test_title[/#{'\.'}(.*?)#{'\"'}/m, 1] end |