Class: RelatonBib::HitCollection

Inherits:
Array
  • Object
show all
Defined in:
lib/relaton_bib/hit_collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fetchedTrueClass, FalseClass (readonly)

Returns:

  • (TrueClass, FalseClass)


4
5
6
# File 'lib/relaton_bib/hit_collection.rb', line 4

def fetched
  @fetched
end

#textString (readonly)

Returns:

  • (String)


7
8
9
# File 'lib/relaton_bib/hit_collection.rb', line 7

def text
  @text
end

#yearString (readonly)

Returns:

  • (String)


10
11
12
# File 'lib/relaton_bib/hit_collection.rb', line 10

def year
  @year
end

Instance Method Details

#fetchRelatonIso::HitCollection

Returns:

  • (RelatonIso::HitCollection)


13
14
15
16
17
18
19
20
21
22
23
# File 'lib/relaton_bib/hit_collection.rb', line 13

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

#inspectString

Returns:

  • (String)


30
31
32
# File 'lib/relaton_bib/hit_collection.rb', line 30

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

#to_sObject



25
26
27
# File 'lib/relaton_bib/hit_collection.rb', line 25

def to_s
  inspect
end