Class: Relaton::Gb::Hit
- Inherits:
-
Core::Hit
- Object
- Core::Hit
- Relaton::Gb::Hit
- Defined in:
- lib/relaton/gb/hit.rb
Overview
Hit.
Instance Attribute Summary collapse
- #docref ⇒ String readonly
- #pid ⇒ String readonly
- #release_date ⇒ Date, NilClass readonly
- #scraper ⇒ RelatonGb::GbScraper, ... readonly
- #status ⇒ String, NilClass readonly
Instance Method Summary collapse
-
#initialize(pid:, docref:, scraper:, **args) ⇒ Hit
constructor
A new instance of Hit.
- #inspect ⇒ String
-
#item ⇒ Isobib::IsoBibliographicItem
Parse page.
Constructor Details
#initialize(pid:, docref:, scraper:, **args) ⇒ Hit
Returns a new instance of Hit.
25 26 27 28 29 30 31 32 |
# File 'lib/relaton/gb/hit.rb', line 25 def initialize(pid:, docref:, scraper:, **args) @pid = pid @docref = docref @scraper = scraper @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)
8 9 10 |
# File 'lib/relaton/gb/hit.rb', line 8 def docref @docref end |
#pid ⇒ String (readonly)
8 9 10 |
# File 'lib/relaton/gb/hit.rb', line 8 def pid @pid end |
#release_date ⇒ Date, NilClass (readonly)
11 12 13 |
# File 'lib/relaton/gb/hit.rb', line 11 def release_date @release_date end |
#scraper ⇒ RelatonGb::GbScraper, ... (readonly)
17 18 19 |
# File 'lib/relaton/gb/hit.rb', line 17 def scraper @scraper end |
#status ⇒ String, NilClass (readonly)
14 15 16 |
# File 'lib/relaton/gb/hit.rb', line 14 def status @status end |
Instance Method Details
#inspect ⇒ String
41 42 43 44 45 |
# File 'lib/relaton/gb/hit.rb', line 41 def inspect "<#{self.class}:#{format('%<id>#.14x', id: object_id << 1)} " \ "@fullIdentifier=\"#{@fetch&.shortref}\" " \ "@docref=\"#{docref}\">" end |
#item ⇒ Isobib::IsoBibliographicItem
Parse page.
36 37 38 |
# File 'lib/relaton/gb/hit.rb', line 36 def item @item ||= scraper.scrape_doc self end |