Class: Relaton::Core::Hit
- Inherits:
-
Object
- Object
- Relaton::Core::Hit
- Defined in:
- lib/relaton/core/hit.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(hit, hit_collection = nil) ⇒ Hit
constructor
A new instance of Hit.
- #inspect ⇒ String
- #item ⇒ RelatonBib::ItemData
- #to_s ⇒ String
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
#hit ⇒ Array<Hash> (readonly)
10 11 12 |
# File 'lib/relaton/core/hit.rb', line 10 def hit @hit end |
#hit_collection ⇒ RelatonBib::HitCollection
7 8 9 |
# File 'lib/relaton/core/hit.rb', line 7 def hit_collection @hit_collection end |
Instance Method Details
#inspect ⇒ String
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 |
#item ⇒ RelatonBib::ItemData
34 35 36 |
# File 'lib/relaton/core/hit.rb', line 34 def item raise "Not implemented" end |
#to_s ⇒ String
20 21 22 |
# File 'lib/relaton/core/hit.rb', line 20 def to_s inspect end |