Exception: Esplanade::Request::BodyIsNotJson

Inherits:
Error
  • Object
show all
Defined in:
lib/esplanade/request/error.rb

Instance Method Summary collapse

Constructor Details

#initialize(method:, path:, raw_path:, content_type:, body:) ⇒ BodyIsNotJson

Returns a new instance of BodyIsNotJson.



48
49
50
51
52
53
54
55
56
# File 'lib/esplanade/request/error.rb', line 48

def initialize(method:, path:, raw_path:, content_type:, body:)
  @method = method
  @path = path
  @raw_path = raw_path
  @content_type = content_type
  @body = body

  super(to_hash)
end

Instance Method Details

#to_hashObject



58
59
60
61
62
63
64
65
66
# File 'lib/esplanade/request/error.rb', line 58

def to_hash
  {
    method: @method,
    path: @path,
    raw_path: @raw_path,
    content_type: @content_type,
    body: @body
  }
end