{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":933839,"defaultBranch":"main","name":"ruby-marc","ownerLogin":"ruby-marc","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2010-09-23T16:48:01.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/412970?v=4","public":true,"private":false,"isOrgOwned":true},"refInfo":{"name":"","listCacheKey":"v0:1678427938.009992","currentOid":""},"activityList":{"items":[{"before":null,"after":"e729274053f0c07262cac5bd019f64ae51c952b7","ref":"refs/heads/allow_custom_record_class_for_readers","pushedAt":"2023-03-10T05:58:58.009Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"billdueber","name":"Bill Dueber","path":"/billdueber","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/114006?s=80&v=4"},"commit":{"message":"Allow passing of custom MARC::Record-derived class to readers\n\nCurrently, the use of MARC::Record is hard-coded into the readers, when really any\nduck-typed alternative would be fine. This makes it hard for people to develop\nlocal customizations on the record (to, e.g., get the sublibraries that hold a monograph),\nthe only option being to build external methods/functions to extract the data\n(e.g., `get_oclcs(rec)`, instead of `rec.oclcs`)\n\nSimilarly, the current MARC::Record implementation is driven largely by the needs of\nthose of us who are more than willing to trade memory use and initialization time\nin order to make many reads from a record slightly faster. If anyone else would rather\nmake different tradeoffs they have no options at all.\n\nThis non-breaking change allows passing in a `record_class:` keyword argument\nto the readers, which will then use that class to build records instead of\na vanilla MARC::Record.\n\n```ruby\n\nclass MyMarc < MARC::Record\n include \"my_library_stuff\"\n include \"someone_elses_standard_identifier_stuff\"\nend\n\nreader = MARC::XMLReader.new(\"/path/to/file.xml\", record_class: MyMarc)\nreader.each do |rec|\n puts rec.oclcs.join(\"\\n\")\nend\n\n```","shortMessageHtmlLink":"Allow passing of custom MARC::Record-derived class to readers"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAADAHTexgA","startCursor":null,"endCursor":null}},"title":"Activity ยท ruby-marc/ruby-marc"}