Exception: Esplanade::Request::Invalid

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:, error:) ⇒ Invalid

Returns a new instance of Invalid.



70
71
72
73
74
75
76
77
78
79
# File 'lib/esplanade/request/error.rb', line 70

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

  super(to_hash)
end

Instance Method Details

#to_hashObject



81
82
83
84
85
86
87
88
89
90
# File 'lib/esplanade/request/error.rb', line 81

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