Class: Cuprum::Rails::Responses::HeadResponse
- Inherits:
-
Object
- Object
- Cuprum::Rails::Responses::HeadResponse
- Defined in:
- lib/cuprum/rails/responses/head_response.rb
Overview
Encapsulates a response without a response body.
Instance Attribute Summary collapse
-
#status ⇒ Integer
readonly
The HTTP status of the response.
Instance Method Summary collapse
-
#call(renderer) ⇒ Object
Calls the renderer’s #head method with the configured status.
-
#initialize(status:) ⇒ HeadResponse
constructor
A new instance of HeadResponse.
Constructor Details
#initialize(status:) ⇒ HeadResponse
Returns a new instance of HeadResponse.
9 10 11 |
# File 'lib/cuprum/rails/responses/head_response.rb', line 9 def initialize(status:) @status = status end |
Instance Attribute Details
#status ⇒ Integer (readonly)
Returns the HTTP status of the response.
14 15 16 |
# File 'lib/cuprum/rails/responses/head_response.rb', line 14 def status @status end |
Instance Method Details
#call(renderer) ⇒ Object
Calls the renderer’s #head method with the configured status.
20 21 22 |
# File 'lib/cuprum/rails/responses/head_response.rb', line 20 def call(renderer) renderer.head(status) end |