class Gbbib::HitCollection

Page of hit collection

Attributes

fetched[R]

@return [TrueClass, FalseClass]

hit_pages[R]

@return [Isobib::HitPages]

scrapper[R]

@return [Gbbib::GbScrapper, Gbbib::SecScrapper, Gbbib::TScrapper]

Public Class Methods

new(hits = nil, hit_pages = nil) click to toggle source

@param hits [Array<Hash>] @param hit_pages [Integer] @param scrapper [Gbbib::GbScrapper, Gbbib::SecScrapper, Gbbib::TScrapper]

# File lib/gbbib/hit_collection.rb, line 18
def initialize(hits = nil, hit_pages = nil)
  concat hits
  @fetched   = false
  @hit_pages = hit_pages
end

Public Instance Methods

fetch() click to toggle source

@return [GbBib::HitCollection]

# File lib/gbbib/hit_collection.rb, line 25
def fetch
  workers = WorkersPool.new 4
  workers.worker(&:fetch)
  each do |hit|
    workers << hit
  end
  workers.end
  workers.result
  @fetched = true
  self
end
inspect() click to toggle source
# File lib/gbbib/hit_collection.rb, line 41
def inspect
  "<#{self.class}:#{format('%#.14x', object_id << 1)} @fetched=#{@fetched}>"
end
to_s() click to toggle source
# File lib/gbbib/hit_collection.rb, line 37
def to_s
  inspect
end