Class: Chronicle::Foursquare::CheckinExtractor

Inherits:
ETL::Extractor
  • Object
show all
Defined in:
lib/chronicle/foursquare/checkin_extractor.rb

Instance Method Summary collapse

Instance Method Details

#extractObject



25
26
27
28
29
# File 'lib/chronicle/foursquare/checkin_extractor.rb', line 25

def extract
  @checkins.each do |checkin|
    yield build_extraction(data: checkin, meta: { actor: @actor })
  end
end

#prepareObject

Raises:

  • (Chronicle::ETL::ExtractionError)


13
14
15
16
17
18
19
# File 'lib/chronicle/foursquare/checkin_extractor.rb', line 13

def prepare
  raise(Chronicle::ETL::ExtractionError, 'Access token is missing') if @config.access_token.empty?

  @proxy = Chronicle::Foursquare::Proxy.new(access_token: @config.access_token)
  @actor = load_actor
  @checkins = load_checkins
end

#results_countObject



21
22
23
# File 'lib/chronicle/foursquare/checkin_extractor.rb', line 21

def results_count
  @checkins.count
end