Class: CricosScrape::ImportContacts

Inherits:
Object
  • Object
show all
Defined in:
lib/cricos_scrape/import_contacts.rb

Instance Method Summary collapse

Constructor Details

#initializeImportContacts

Returns a new instance of ImportContacts.



6
7
8
# File 'lib/cricos_scrape/import_contacts.rb', line 6

def initialize
  @agent = CricosScrape.agent
end

Instance Method Details

#performObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/cricos_scrape/import_contacts.rb', line 10

def perform
  contacts = ContactImporter.new(@agent).run

  if contacts.any?
    contacts.each do |contact|
      puts contact.to_json
    end
  else
    STDERR.puts "Something not right, there is no Contacts returned"
  end
end