Class: Qiita::ResponseRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/qiita/response_renderer.rb

Instance Method Summary collapse

Constructor Details

#initialize(response, color: nil, show_header: nil, show_body: nil) ⇒ ResponseRenderer

Returns a new instance of ResponseRenderer.



3
4
5
6
7
8
# File 'lib/qiita/response_renderer.rb', line 3

def initialize(response, color: nil, show_header: nil, show_body: nil)
  @response = response
  @color = color
  @show_body = show_body
  @show_header = show_header
end

Instance Method Details

#to_sObject



10
11
12
13
14
15
16
# File 'lib/qiita/response_renderer.rb', line 10

def to_s
  template % {
    status: status,
    headers: headers,
    body: body,
  }
end