Class: GnCrossmap::Resolver

Inherits:
Object
  • Object
show all
Defined in:
lib/gn_crossmap/resolver.rb

Overview

Sends data to GN Resolver and collects results

Instance Method Summary collapse

Constructor Details

#initialize(writer, data_source_id, resolver_url, stats) ⇒ Resolver

Returns a new instance of Resolver.



4
5
6
7
8
9
10
11
12
# File 'lib/gn_crossmap/resolver.rb', line 4

def initialize(writer, data_source_id, resolver_url, stats)
  @stats = stats
  @resolver_url = resolver_url
  @processor = GnCrossmap::ResultProcessor.new(writer, @stats)
  @ds_id = data_source_id
  @count = 0
  @current_data = {}
  @batch = 200
end

Instance Method Details

#resolve(data) {|@stats.stats| ... } ⇒ Object

Yields:

  • (@stats.stats)


14
15
16
17
18
19
# File 'lib/gn_crossmap/resolver.rb', line 14

def resolve(data)
  update_stats(data.size)
  block_given? ? process(data, &Proc.new) : process(data)
  wrap_up
  yield(@stats.stats) if block_given?
end