Exception: Toy::RecordInvalid

Inherits:
Error show all
Defined in:
lib/toy/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record) ⇒ RecordInvalid

Returns a new instance of RecordInvalid.



8
9
10
11
# File 'lib/toy/exceptions.rb', line 8

def initialize(record)
  @record = record
  super("Invalid record: #{@record.errors.full_messages.to_sentence}")
end

Instance Attribute Details

#recordObject (readonly)

Returns the value of attribute record.



7
8
9
# File 'lib/toy/exceptions.rb', line 7

def record
  @record
end