Exception: ApiRecord::RecordInvalidError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/api_record/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record, response = nil) ⇒ RecordInvalidError



7
8
9
10
11
12
# File 'lib/api_record/errors.rb', line 7

def initialize(record, response = nil)
  @record = record
  @response = response
  message = "Validation failed: #{record.errors.full_messages.join(', ')}"
  super(message)
end

Instance Attribute Details

#recordObject (readonly)

Returns the value of attribute record.



5
6
7
# File 'lib/api_record/errors.rb', line 5

def record
  @record
end

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/api_record/errors.rb', line 5

def response
  @response
end