Class: Darjeelink::RebrandlyImporter
- Inherits:
-
Object
- Object
- Darjeelink::RebrandlyImporter
- Defined in:
- app/importers/darjeelink/rebrandly_importer.rb
Instance Method Summary collapse
- #import ⇒ Object
-
#initialize ⇒ RebrandlyImporter
constructor
A new instance of RebrandlyImporter.
Constructor Details
#initialize ⇒ RebrandlyImporter
Returns a new instance of RebrandlyImporter.
5 6 7 8 |
# File 'app/importers/darjeelink/rebrandly_importer.rb', line 5 def initialize @duplicates = [] @api = Rebrandly::Api.new end |
Instance Method Details
#import ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/importers/darjeelink/rebrandly_importer.rb', line 10 def import import_rebrandly_links Rails.logger.info("Imported #{api.link_count - duplicates.count} links from Rebrandly") duplicate_string = duplicates.join("\n") Rails.logger.warn("Duplicates:\n#{duplicate_string}") unless duplicates.empty? end |