Class: RelatonGb::Hit
- Inherits:
-
RelatonBib::Hit
- Object
- RelatonBib::Hit
- RelatonGb::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
- #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
Constructor Details
#initialize(pid:, docref:, scrapper:, **args) ⇒ Hit
Returns a new instance of Hit.
24 25 26 27 28 29 30 31 |
# File 'lib/relaton_gb/hit.rb', line 24 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)
7 8 9 |
# File 'lib/relaton_gb/hit.rb', line 7 def docref @docref end |
#pid ⇒ String (readonly)
7 8 9 |
# File 'lib/relaton_gb/hit.rb', line 7 def pid @pid end |
#release_date ⇒ Date, NilClass (readonly)
10 11 12 |
# File 'lib/relaton_gb/hit.rb', line 10 def release_date @release_date end |
#scrapper ⇒ RelatonGb::GbScrapper, ... (readonly)
16 17 18 |
# File 'lib/relaton_gb/hit.rb', line 16 def scrapper @scrapper end |
#status ⇒ String, NilClass (readonly)
13 14 15 |
# File 'lib/relaton_gb/hit.rb', line 13 def status @status end |
Instance Method Details
#fetch ⇒ Isobib::IsoBibliographicItem
Parse page.
35 36 37 |
# File 'lib/relaton_gb/hit.rb', line 35 def fetch @fetch ||= scrapper.scrape_doc self end |
#inspect ⇒ String
40 41 42 43 44 |
# File 'lib/relaton_gb/hit.rb', line 40 def inspect "<#{self.class}:#{format('%<id>#.14x', id: object_id << 1)} " \ "@fullIdentifier=\"#{@fetch&.shortref}\" " \ "@docref=\"#{docref}\">" end |