Class: Peictt::Builder::HttpHeader
- 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
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
Instance Method Summary collapse
-
#initialize(arg) ⇒ HttpHeader
constructor
A new instance of HttpHeader.
- #status ⇒ Object
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
#args ⇒ Object (readonly)
Returns the value of attribute args.
4 5 6 |
# File 'lib/peictt/builder/http_header.rb', line 4 def args @args end |
#headers ⇒ Object (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
#status ⇒ Object
18 19 20 |
# File 'lib/peictt/builder/http_header.rb', line 18 def status @status || 200 end |