Class: ItemProcessor

Inherits:
Object
  • Object
show all
Defined in:
app/processors/item_processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(items, listing) ⇒ ItemProcessor

Returns a new instance of ItemProcessor


4
5
6
7
# File 'app/processors/item_processor.rb', line 4

def initialize(items, listing)
  @items = items
  @listing = listing
end

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items


2
3
4
# File 'app/processors/item_processor.rb', line 2

def items
  @items
end

#listingObject (readonly)

Returns the value of attribute listing


2
3
4
# File 'app/processors/item_processor.rb', line 2

def listing
  @listing
end

Instance Method Details

#processObject


9
10
11
12
# File 'app/processors/item_processor.rb', line 9

def process
  item = items_repository.update_link_and_image(listing.item_name, listing.link_url, listing.image_url)
  stat_processor(item.stats).process
end