class RelatonGb::Hit

Hit.

Attributes

docref[R]

@return [String]

pid[R]

@return [String]

release_date[R]

@return [Date, NilClass]

scrapper[R]

@return [RelatonGb::GbScrapper, RelatonGb::SecScraper, RelatonGb::TScrapper]

status[R]

@return [String, NilClass]

Public Class Methods

new(pid:, docref:, scrapper:, **args) click to toggle source

@param pid [String] @param docref [String] @parma scrapper [RelatonGb::GbScrapper, RelatonGb::SecScraper, RelatonGb::TScrapper] @param release_date [String] @status [String, NilClass] @param hit_collection [RelatonGb:HitCollection, NilClass]

# 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

Public Instance Methods

fetch() click to toggle source

Parse page. @return [Isobib::IsoBibliographicItem]

# File lib/relaton_gb/hit.rb, line 35
def fetch
  @fetch ||= scrapper.scrape_doc self
end
inspect() click to toggle source

@return [String]

# 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