Class: Chronicle::Imessage::LocalContacts

Inherits:
Object
  • Object
show all
Defined in:
lib/chronicle/imessage/local_contacts.rb

Overview

Load contacts from local macOS address book

Instance Method Summary collapse

Constructor Details

#initializeLocalContacts

Returns a new instance of LocalContacts.



8
9
10
11
# File 'lib/chronicle/imessage/local_contacts.rb', line 8

def initialize
  filename = find_local_icloud_address_book
  @db = SQLite3::Database.new(filename, results_as_hash: true)
end

Instance Method Details

#contact_identifier_to_details(identifier) ⇒ Object



13
14
15
# File 'lib/chronicle/imessage/local_contacts.rb', line 13

def contact_identifier_to_details(identifier)
  contacts[identifier]
end

#contactsObject



17
18
19
20
21
22
23
24
# File 'lib/chronicle/imessage/local_contacts.rb', line 17

def contacts
  @contacts ||= begin
    c = {}
    c.merge!(load_phone_numbers)
    c.merge!(load_email_addresses)
    c
  end
end

#my_icloud_accountObject



30
31
32
# File 'lib/chronicle/imessage/local_contacts.rb', line 30

def 
  @my_icloud_account ||= 
end

#my_phone_contactObject



26
27
28
# File 'lib/chronicle/imessage/local_contacts.rb', line 26

def my_phone_contact
  @my_phone_contact ||= load_my_phone_contact
end