Class: Plz::ResponseRenderer
- Inherits:
-
Object
- Object
- Plz::ResponseRenderer
- Defined in:
- lib/plz/response_renderer.rb
Class Method Summary collapse
-
.call(*args) ⇒ Object
Shortcut for #call method.
Instance Method Summary collapse
-
#call ⇒ String
Renders response with given options.
-
#initialize(status: nil, headers: nil, body: nil, response_header: nil, response_body: nil, color: nil) ⇒ ResponseRenderer
constructor
A new instance of ResponseRenderer.
Constructor Details
#initialize(status: nil, headers: nil, body: nil, response_header: nil, response_body: nil, color: nil) ⇒ ResponseRenderer
Returns a new instance of ResponseRenderer.
14 15 16 17 18 19 20 21 |
# File 'lib/plz/response_renderer.rb', line 14 def initialize(status: nil, headers: nil, body: nil, response_header: nil, response_body: nil, color: nil) @status = status @headers = headers @body = body @show_response_header = response_header @show_response_body = response_body @color_response = color end |
Class Method Details
.call(*args) ⇒ Object
Shortcut for #call method
4 5 6 |
# File 'lib/plz/response_renderer.rb', line 4 def self.call(*args) new(*args).call end |
Instance Method Details
#call ⇒ String
Renders response with given options
25 26 27 28 29 30 31 |
# File 'lib/plz/response_renderer.rb', line 25 def call template % { status: status, headers: headers, body: body, } end |