Method: MARC::Record#to_hash
- Defined in:
- lib/marc/record.rb
#to_hash ⇒ Object
Returns a (roundtrippable) hash representation for MARC-in-JSON
291 292 293 294 295 296 297 |
# File 'lib/marc/record.rb', line 291 def to_hash record_hash = {"leader" => @leader, "fields" => []} @fields.each do |field| record_hash["fields"] << field.to_hash end record_hash end |