Exception: MARC::RecordException

Inherits:
Exception
  • Object
show all
Defined in:
lib/marc/exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record) ⇒ RecordException

Returns a new instance of RecordException.



11
12
13
14
15
# File 'lib/marc/exception.rb', line 11

def initialize(record)
  @record = record
  id = @record["001"] || "<record with no 001>"
  super("Record #{id}: #{@record.errors.join("\n....")}")
end

Instance Attribute Details

#recordObject (readonly)

Returns the value of attribute record.



9
10
11
# File 'lib/marc/exception.rb', line 9

def record
  @record
end