Class: RelatonGb::Hit
- Inherits:
-
Object
- Object
- RelatonGb::Hit
- Defined in:
- lib/relaton_gb/hit.rb
Overview
Hit.
Instance Attribute Summary collapse
- #docref ⇒ String readonly
- #hit_collection ⇒ Isobib::HitCollection readonly
- #pid ⇒ String readonly
- #release_date ⇒ Date, NilClass readonly
- #scrapper ⇒ RelatonGb::GbScrapper, ... readonly
- #status ⇒ String, NilClass readonly
Instance Method Summary collapse
-
#fetch ⇒ Isobib::IsoBibliographicItem
Parse page.
-
#initialize(pid:, docref:, scrapper:, **args) ⇒ Hit
constructor
A new instance of Hit.
- #inspect ⇒ String
- #to_s ⇒ String
Constructor Details
#initialize(pid:, docref:, scrapper:, **args) ⇒ Hit
Returns a new instance of Hit.
27 28 29 30 31 32 33 34 |
# File 'lib/relaton_gb/hit.rb', line 27 def initialize(pid:, docref:, scrapper:, **args) @pid = pid @docref = docref @scrapper = scrapper @release_date = Date.parse args[:release_date] if args[:release_date] @status = args[:status] @hit_collection = args[:hit_collection] end |
Instance Attribute Details
#docref ⇒ String (readonly)
10 11 12 |
# File 'lib/relaton_gb/hit.rb', line 10 def docref @docref end |
#hit_collection ⇒ Isobib::HitCollection (readonly)
7 8 9 |
# File 'lib/relaton_gb/hit.rb', line 7 def hit_collection @hit_collection end |
#pid ⇒ String (readonly)
10 11 12 |
# File 'lib/relaton_gb/hit.rb', line 10 def pid @pid end |
#release_date ⇒ Date, NilClass (readonly)
13 14 15 |
# File 'lib/relaton_gb/hit.rb', line 13 def release_date @release_date end |
#scrapper ⇒ RelatonGb::GbScrapper, ... (readonly)
19 20 21 |
# File 'lib/relaton_gb/hit.rb', line 19 def scrapper @scrapper end |
#status ⇒ String, NilClass (readonly)
16 17 18 |
# File 'lib/relaton_gb/hit.rb', line 16 def status @status end |
Instance Method Details
#fetch ⇒ Isobib::IsoBibliographicItem
Parse page.
38 39 40 |
# File 'lib/relaton_gb/hit.rb', line 38 def fetch @fetch ||= scrapper.scrape_doc self end |
#inspect ⇒ String
48 49 50 51 52 |
# File 'lib/relaton_gb/hit.rb', line 48 def inspect "<#{self.class}:#{format('%#.14x', object_id << 1)} "\ "@fullIdentifier=\"#{@fetch&.shortref}\" "\ "@docref=\"#{docref}\">" end |
#to_s ⇒ String
43 44 45 |
# File 'lib/relaton_gb/hit.rb', line 43 def to_s inspect end |