Class: Consummo::FeedProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/consummo/feed_processor.rb

Instance Method Summary collapse

Constructor Details

#initialize(feeds = [], enrichers: []) ⇒ FeedProcessor

Returns a new instance of FeedProcessor.



3
4
5
6
# File 'lib/consummo/feed_processor.rb', line 3

def initialize(feeds = [], enrichers: [])
  @feeds = feeds
  @enrichers = enrichers
end

Instance Method Details

#processObject



8
9
10
11
12
# File 'lib/consummo/feed_processor.rb', line 8

def process
  producer = ItemProducer.new(feeds: @feeds)
  consumer = ItemConsumer.new(items: producer.produce, enrichers: @enrichers)
  persist(consumer.consume)
end