Class: Chronicle::Imessage::ImessageExtractor

Inherits:
ETL::Extractor
  • Object
show all
Defined in:
lib/chronicle/imessage/imessage_extractor.rb

Instance Method Summary collapse

Instance Method Details

#extractObject



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/chronicle/imessage/imessage_extractor.rb', line 27

def extract
  @messages.each do |message|
    meta = {}
    meta[:participants] = @chats[message['chat_id']]
    meta[:attachments] = @attachments[message['message_id']] if @attachments
    meta[:my_phone_contact] = @my_phone_contact if @my_phone_contact.values.all?
    meta[:my_icloud_account] = @my_icloud_account if @my_icloud_account.values.all?

    yield build_extraction(data: message, meta:)
  end
end

#prepareObject



23
24
25
# File 'lib/chronicle/imessage/imessage_extractor.rb', line 23

def prepare
  prepare_data
end

#results_countObject



39
40
41
# File 'lib/chronicle/imessage/imessage_extractor.rb', line 39

def results_count
  @messages.count
end