Sha256: b7ed98ece8004f6b88c8410822797f364ae8c2c06c590c2bac6309aeb50ba284

Contents?: true

Size: 741 Bytes

Versions: 13

Compression:

Stored size: 741 Bytes

Contents

module RelatonBib
  class Hit
    # @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('%#.14x', object_id << 1)} "\
      "@text=\"#{@hit_collection&.text}\" "\
      "@fetched=\"#{!@fetch.nil?}\" "\
      "@fullIdentifier=\"#{@fetch&.shortref(nil)}\" "\
      "@title=\"#{@hit[:code]}\">"
    end

    # @return [String]
    def to_xml(**opts)
      fetch.to_xml **opts
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
relaton-bib-0.7.0 lib/relaton_bib/hit.rb
relaton-bib-0.6.0 lib/relaton_bib/hit.rb
relaton-bib-0.5.2 lib/relaton_bib/hit.rb
relaton-bib-0.5.1 lib/relaton_bib/hit.rb
relaton-bib-0.5.0 lib/relaton_bib/hit.rb
relaton-bib-0.4.1 lib/relaton_bib/hit.rb
relaton-bib-0.4.0 lib/relaton_bib/hit.rb
relaton-bib-0.3.12 lib/relaton_bib/hit.rb
relaton-bib-0.3.11 lib/relaton_bib/hit.rb
relaton-bib-0.3.10 lib/relaton_bib/hit.rb
relaton-bib-0.3.9 lib/relaton_bib/hit.rb
relaton-bib-0.3.8 lib/relaton_bib/hit.rb
relaton-bib-0.3.7 lib/relaton_bib/hit.rb