Sha256: d9d4527aec19aabb169ad7dffaf0c90ff9a46f844904f58088f04fb5857abfd5

Contents?: true

Size: 632 Bytes

Versions: 13

Compression:

Stored size: 632 Bytes

Contents

module RelatonBib
  class HitCollection < Array
    # @return [TrueClass, FalseClass]
    attr_reader :fetched

    # @return [String]
    attr_reader :text

    # @return [String]
    attr_reader :year

    # @return [RelatonIso::HitCollection]
    def fetch
      workers = WorkersPool.new 4
      workers.worker(&:fetch)
      each do |hit|
        workers << hit
      end
      workers.end
      workers.result
      @fetched = true
      self
    end

    def to_s
      inspect
    end

    # @return [String]
    def inspect
      "<#{self.class}:#{format('%#.14x', object_id << 1)} @fetched=#{@fetched}>"
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
relaton-bib-0.7.0 lib/relaton_bib/hit_collection.rb
relaton-bib-0.6.0 lib/relaton_bib/hit_collection.rb
relaton-bib-0.5.2 lib/relaton_bib/hit_collection.rb
relaton-bib-0.5.1 lib/relaton_bib/hit_collection.rb
relaton-bib-0.5.0 lib/relaton_bib/hit_collection.rb
relaton-bib-0.4.1 lib/relaton_bib/hit_collection.rb
relaton-bib-0.4.0 lib/relaton_bib/hit_collection.rb
relaton-bib-0.3.12 lib/relaton_bib/hit_collection.rb
relaton-bib-0.3.11 lib/relaton_bib/hit_collection.rb
relaton-bib-0.3.10 lib/relaton_bib/hit_collection.rb
relaton-bib-0.3.9 lib/relaton_bib/hit_collection.rb
relaton-bib-0.3.8 lib/relaton_bib/hit_collection.rb
relaton-bib-0.3.7 lib/relaton_bib/hit_collection.rb