Class: Dox::Entities::Example
- Inherits:
-
Object
- Object
- Dox::Entities::Example
- Extended by:
- Forwardable
- Defined in:
- lib/dox/entities/example.rb
Instance Method Summary collapse
-
#initialize(details, request, response) ⇒ Example
constructor
A new instance of Example.
- #request_body ⇒ Object
-
#request_fullpath ⇒ Object
Rails 4 includes the body params in the request_fullpath.
- #request_headers ⇒ Object
- #request_identifier ⇒ Object
- #response_headers ⇒ Object
Constructor Details
#initialize(details, request, response) ⇒ Example
12 13 14 15 16 |
# File 'lib/dox/entities/example.rb', line 12 def initialize(details, request, response) @desc = details[:description] @request = request @response = response end |
Instance Method Details
#request_body ⇒ Object
18 19 20 |
# File 'lib/dox/entities/example.rb', line 18 def request_body @request_body ||= request.body.read end |
#request_fullpath ⇒ Object
Rails 4 includes the body params in the request_fullpath
35 36 37 38 39 40 41 |
# File 'lib/dox/entities/example.rb', line 35 def request_fullpath if request.query_parameters.present? "#{request_path}?#{request_url_query_parameters}" else request_path end end |
#request_headers ⇒ Object
30 31 32 |
# File 'lib/dox/entities/example.rb', line 30 def request_headers @request_headers ||= filter_headers(request) end |
#request_identifier ⇒ Object
22 23 24 |
# File 'lib/dox/entities/example.rb', line 22 def request_identifier @desc end |
#response_headers ⇒ Object
26 27 28 |
# File 'lib/dox/entities/example.rb', line 26 def response_headers @response_headers ||= filter_headers(response) end |