Class: Relaton::Core::Hit
- Inherits:
-
Object
- Object
- Relaton::Core::Hit
show all
- Defined in:
- lib/relaton/core/hit.rb
Direct Known Subclasses
Bsi::Hit, Relaton::Calconnect::Hit, Relaton::Ccsds::Hit, Relaton::Cen::Hit, Gb::Hit, Iec::Hit, Iso::Hit, Itu::Hit, Jis::Hit, Nist::Hit, Ogc::Hit, Plateau::Hit, Un::Hit, Xsf::Hit
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(hit, hit_collection = nil) ⇒ Hit
Returns a new instance of 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>
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
#fetched? ⇒ Boolean
37
38
39
|
# File 'lib/relaton/core/hit.rb', line 37
def fetched?
!@item.nil?
end
|
#inspect ⇒ String
25
26
27
28
29
30
|
# File 'lib/relaton/core/hit.rb', line 25
def inspect
"<#{self.class}:#{format('%<id>#.14x', id: object_id << 1)} " \
"@reference=\"#{@hit_collection&.ref}\" " \
"@fetched=\"#{fetched?}\" " \
"@docidentifier=\"#{@hit[:code]}\">"
end
|
#item ⇒ RelatonBib::ItemData
33
34
35
|
# File 'lib/relaton/core/hit.rb', line 33
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
|
#to_xml(**opts) ⇒ String
44
45
46
|
# File 'lib/relaton/core/hit.rb', line 44
def to_xml(**opts)
item.to_xml(**opts)
end
|