Class: CricosScrape::ImportContacts
- Inherits:
-
Object
- Object
- CricosScrape::ImportContacts
- Defined in:
- lib/cricos_scrape/import_contacts.rb
Instance Method Summary collapse
-
#initialize ⇒ ImportContacts
constructor
A new instance of ImportContacts.
- #perform ⇒ Object
Constructor Details
#initialize ⇒ ImportContacts
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
#perform ⇒ Object
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 |