Class: Dolly::HeaderRequest

Inherits:
Object
  • Object
show all
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

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

Returns:

  • (Boolean)


16
17
18
# File 'lib/dolly/request_header.rb', line 16

def json?
  @collection[CONTENT_TYPE_KEY] == JSON_CONTENT
end