Sha256: dd36f6237dcf1a62eef71e8ac050798869372aa4847db37ef413dc09ebb358a1
Contents?: true
Size: 1.33 KB
Versions: 51
Compression:
Stored size: 1.33 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 [RelatonIso::HitCollection, RelatonNist: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
51 entries across 51 versions & 1 rubygems