Class: ItemBuilder::Modes::PreconditionCreate::ShopeeService

Inherits:
Base
  • Object
show all
Defined in:
lib/item_builder/modes/precondition_create/shopee_service.rb

Instance Attribute Summary

Attributes inherited from Base

#listing

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from ItemBuilder::Modes::PreconditionCreate::Base

Instance Method Details

#imagesObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/item_builder/modes/precondition_create/shopee_service.rb', line 15

def images
  listing.item_listing_variant_images.map do |img|
    {
      id: img.id,
      local_id: img.local_id,
      local_url: img.local_url,
      url: img.image.image.url(:xlarge, timestamp: false)
    }
  end
end

#performObject



8
9
10
11
12
13
# File 'lib/item_builder/modes/precondition_create/shopee_service.rb', line 8

def perform
  {
    internal_data: listing.internal_data,
    images: images
  }
end