Class: RestCore::JsonResponse::ParseError

Inherits:
Object
  • Object
show all
Defined in:
lib/rest-core/middleware/json_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cause, body) ⇒ ParseError

Returns a new instance of ParseError.



11
12
13
14
15
# File 'lib/rest-core/middleware/json_response.rb', line 11

def initialize cause, body
  msg = cause.message.force_encoding('utf-8')
  super("#{msg}\nOriginal text: #{body}")
  @cause, @body = cause, body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



10
11
12
# File 'lib/rest-core/middleware/json_response.rb', line 10

def body
  @body
end

#causeObject (readonly)

Returns the value of attribute cause.



10
11
12
# File 'lib/rest-core/middleware/json_response.rb', line 10

def cause
  @cause
end