Sha256: 15d0bf880f9bc24628981c816908265371377625ce3d4faeb96805ccc623dee2
Contents?: true
Size: 433 Bytes
Versions: 10
Compression:
Stored size: 433 Bytes
Contents
module ModsDisplay::ModelExtension def self.included(base) base.extend ClassMethods base.class_eval do def mods_display_xml xml = self.class.mods_xml_source.call(self) return if xml.nil? mods = Stanford::Mods::Record.new mods.from_str(xml, false) mods end end end module ClassMethods def mods_xml_source &xml @mods_xml_source ||= xml end end end
Version data entries
10 entries across 10 versions & 1 rubygems