Class: Peictt::Builder::HttpHeader

Inherits:
Object
  • Object
show all
Defined in:
lib/peictt/builder/http_header.rb

Constant Summary collapse

ERROR_MSG =
"First for render argument must be a view"\
"name as a Symbol or"\
"string; Second argument for render must be type Hash".freeze
MODIFIERS =
[:text, :json, :headers, :status].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arg) ⇒ HttpHeader

Returns a new instance of HttpHeader.



12
13
14
15
16
# File 'lib/peictt/builder/http_header.rb', line 12

def initialize(arg)
  @args = arg
  @headers = { "Content-Type" => "text/html" }
  process_args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



4
5
6
# File 'lib/peictt/builder/http_header.rb', line 4

def args
  @args
end

#headersObject (readonly)

Returns the value of attribute headers.



5
6
7
# File 'lib/peictt/builder/http_header.rb', line 5

def headers
  @headers
end

Instance Method Details

#statusObject



18
19
20
# File 'lib/peictt/builder/http_header.rb', line 18

def status
  @status || 200
end