Class: Dolly::HeaderRequest
- Inherits:
-
Object
- Object
- Dolly::HeaderRequest
- Extended by:
- Forwardable
- Defined in:
- lib/dolly/request_header.rb
Constant Summary collapse
- CONTENT_TYPE_KEY =
'Content-Type'
- JSON_CONTENT =
'application/json'
Instance Method Summary collapse
-
#initialize(hash = nil) ⇒ HeaderRequest
constructor
A new instance of HeaderRequest.
- #json? ⇒ Boolean
Constructor Details
#initialize(hash = nil) ⇒ HeaderRequest
Returns a new instance of HeaderRequest.
12 13 14 |
# File 'lib/dolly/request_header.rb', line 12 def initialize hash = nil @collection = hash || default_value end |
Instance Method Details
#json? ⇒ Boolean
16 17 18 |
# File 'lib/dolly/request_header.rb', line 16 def json? @collection[CONTENT_TYPE_KEY] == JSON_CONTENT end |