Exception: ActionKitRest::Response::ValidationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/action_kit_rest/response/validation_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ ValidationError

Returns a new instance of ValidationError.



6
7
8
9
10
11
# File 'lib/action_kit_rest/response/validation_error.rb', line 6

def initialize(params)
  self.url = params[:url]
  self.body = params[:body]
  self.errors = JSON.parse(params[:body])['errors']
  super()
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



4
5
6
# File 'lib/action_kit_rest/response/validation_error.rb', line 4

def body
  @body
end

#errorsObject

Returns the value of attribute errors.



4
5
6
# File 'lib/action_kit_rest/response/validation_error.rb', line 4

def errors
  @errors
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/action_kit_rest/response/validation_error.rb', line 4

def url
  @url
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/action_kit_rest/response/validation_error.rb', line 13

def to_s
  "#{super()} \n url: #{url} \n body: #{body} \n errors: #{errors}"
end