Class: Mosaic::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/mosaic/response.rb

Overview

Used to build a response for sinatra to serve

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request) ⇒ Response

Returns a new instance of Response.



7
8
9
10
11
12
13
# File 'lib/mosaic/response.rb', line 7

def initialize(request)
  @view_format = :erb
  @output_format = :html
  @layout = :'layouts/application'
  @request = request
  @response_code = 200
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



4
5
6
# File 'lib/mosaic/response.rb', line 4

def content
  @content
end

#layoutObject

Returns the value of attribute layout.



4
5
6
# File 'lib/mosaic/response.rb', line 4

def layout
  @layout
end

#output_formatObject

Returns the value of attribute output_format.



4
5
6
# File 'lib/mosaic/response.rb', line 4

def output_format
  @output_format
end

#requestObject (readonly)

Returns the value of attribute request.



5
6
7
# File 'lib/mosaic/response.rb', line 5

def request
  @request
end

#response_codeObject

Returns the value of attribute response_code.



4
5
6
# File 'lib/mosaic/response.rb', line 4

def response_code
  @response_code
end

#view_formatObject

Returns the value of attribute view_format.



4
5
6
# File 'lib/mosaic/response.rb', line 4

def view_format
  @view_format
end