Class: Chronicle::Safari::BrowseExtractor

Inherits:
ETL::Extractor
  • Object
show all
Defined in:
lib/chronicle/safari/browse_extractor.rb

Instance Method Summary collapse

Instance Method Details

#extractObject



25
26
27
28
29
30
31
32
33
# File 'lib/chronicle/safari/browse_extractor.rb', line 25

def extract
  @history.each do |entry|
    entry.transform_keys!(&:to_sym)

    meta = {}
    meta[:my_icloud_account] = @icloud_account
    yield build_extraction(data: entry, meta:)
  end
end

#prepareObject



19
20
21
22
23
# File 'lib/chronicle/safari/browse_extractor.rb', line 19

def prepare
  @db = SQLite3::Database.new(@config.input, results_as_hash: true)
  @icloud_account = 
  @history = load_history
end

#results_countObject



35
36
37
# File 'lib/chronicle/safari/browse_extractor.rb', line 35

def results_count
  @history.count
end