Sha256: 5f26c4cb0cb2e297d14890c75a33d9caec988415c91181b41de9f2e83a4124f3
Contents?: true
Size: 1.23 KB
Versions: 19
Compression:
Stored size: 1.23 KB
Contents
module RelatonBib class Hit # @return [RelatonBib::HitCollection] attr_reader :hit_collection # @return [Array<Hash>] attr_reader :hit # @param hit [Hash] # @param hit_collection [RelatonBib::HitCollection] def initialize(hit, hit_collection = nil) @hit = hit @hit_collection = hit_collection end # @return [String] def to_s inspect end # @return [String] def inspect "<#{self.class}:#{format('%<id>#.14x', id: object_id << 1)} " \ "@text=\"#{@hit_collection&.text}\" " \ "@fetched=\"#{!@fetch.nil?}\" " \ "@fullIdentifier=\"#{@fetch&.shortref(nil)}\" " \ "@title=\"#{@hit[:code]}\">" end def fetch raise "Not implemented" end # @param opts [Hash] # @option opts [Nokogiri::XML::Builder] :builder XML builder # @option opts [Boolean] :bibdata # @option opts [String, Symbol] :lang language # @return [String] XML def to_xml(**opts) if opts[:builder] fetch.to_xml(**opts) else builder = Nokogiri::XML::Builder.new(encoding: "UTF-8") do |xml| fetch.to_xml(**opts.merge(builder: xml)) end builder.doc.root.to_xml end end end end
Version data entries
19 entries across 19 versions & 1 rubygems