Class: RelatonBib::Hit
- Inherits:
-
Object
- Object
- RelatonBib::Hit
- Defined in:
- lib/relaton_bib/hit.rb
Instance Attribute Summary collapse
- #hit ⇒ Array<Hash> readonly
Instance Method Summary collapse
-
#initialize(hit, hit_collection = nil) ⇒ Hit
constructor
A new instance of Hit.
- #inspect ⇒ String
- #to_s ⇒ String
- #to_xml(**opts) ⇒ String
Constructor Details
#initialize(hit, hit_collection = nil) ⇒ Hit
Returns a new instance of Hit.
8 9 10 11 |
# File 'lib/relaton_bib/hit.rb', line 8 def initialize(hit, hit_collection = nil) @hit = hit @hit_collection = hit_collection end |
Instance Attribute Details
#hit ⇒ Array<Hash> (readonly)
4 5 6 |
# File 'lib/relaton_bib/hit.rb', line 4 def hit @hit end |
Instance Method Details
#inspect ⇒ String
19 20 21 22 23 24 25 |
# File 'lib/relaton_bib/hit.rb', line 19 def inspect "<#{self.class}:#{format('%#.14x', object_id << 1)} "\ "@text=\"#{@hit_collection&.text}\" "\ "@fetched=\"#{!@fetch.nil?}\" "\ "@fullIdentifier=\"#{@fetch&.shortref(nil)}\" "\ "@title=\"#{@hit[:code]}\">" end |
#to_s ⇒ String
14 15 16 |
# File 'lib/relaton_bib/hit.rb', line 14 def to_s inspect end |
#to_xml(**opts) ⇒ String
28 29 30 |
# File 'lib/relaton_bib/hit.rb', line 28 def to_xml(**opts) fetch.to_xml **opts end |