Class: Relaton::Core::Hit

Inherits:
Object
  • Object
show all
Defined in:
lib/relaton/core/hit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hit, hit_collection = nil) ⇒ Hit



14
15
16
17
# File 'lib/relaton/core/hit.rb', line 14

def initialize(hit, hit_collection = nil)
  @hit            = hit
  @hit_collection = WeakRef.new hit_collection if hit_collection
end

Instance Attribute Details

#hitArray<Hash> (readonly)



10
11
12
# File 'lib/relaton/core/hit.rb', line 10

def hit
  @hit
end

#hit_collectionRelatonBib::HitCollection



7
8
9
# File 'lib/relaton/core/hit.rb', line 7

def hit_collection
  @hit_collection
end

Instance Method Details

#inspectString



25
26
27
28
29
30
31
# File 'lib/relaton/core/hit.rb', line 25

def inspect
  "<#{self.class}:#{format('%<id>#.14x', id: object_id << 1)} " \
    "@text=\"#{@hit_collection&.text}\" " \
    "@fetched=\"#{[email protected]?}\" " \
    "@fullIdentifier=\"#{@fetch&.shortref(nil)}\" " \
    "@title=\"#{@hit[:code]}\">"
end

#itemRelatonBib::ItemData



34
35
36
# File 'lib/relaton/core/hit.rb', line 34

def item
  raise "Not implemented"
end

#to_sString



20
21
22
# File 'lib/relaton/core/hit.rb', line 20

def to_s
  inspect
end