Class: ItemBuilderMwh::Modes::Create::ShopeeService
- Inherits:
-
Base
- Object
- Base
- ItemBuilderMwh::Modes::Create::ShopeeService
show all
- Defined in:
- lib/item_builder_mwh/modes/create/shopee_service.rb
Instance Attribute Summary
Attributes inherited from Base
#item_listing, #shipping_providers
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#brand ⇒ Object
24
25
26
27
28
29
30
|
# File 'lib/item_builder_mwh/modes/create/shopee_service.rb', line 24
def brand
{
id: item_listing&.item_listing_brand&.id,
local_id: item_listing&.item_listing_brand&.shopee&.local_id,
name: item_listing&.item_listing_brand&.shopee&.name
}
end
|
#category ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/item_builder_mwh/modes/create/shopee_service.rb', line 16
def category
{
id: item_listing&.item_listing_category&.id,
local_id: item_listing&.item_listing_category&.shopee&.local_id,
name: item_listing&.item_listing_category&.shopee&.name
}
end
|
#map_shipping_providers ⇒ Object
32
33
34
35
36
37
38
39
40
|
# File 'lib/item_builder_mwh/modes/create/shopee_service.rb', line 32
def map_shipping_providers
shipping_providers.map do |shipping_provider|
{
local_id: shipping_provider.local_id,
name: shipping_provider.name,
enabled: shipping_provider.enabled
}
end
end
|
8
9
10
11
12
13
14
|
# File 'lib/item_builder_mwh/modes/create/shopee_service.rb', line 8
def perform
{
category: category,
brand: brand,
shipping_providers: map_shipping_providers
}
end
|