Class: ItemBuilder::Modes::SimpleService

Inherits:
Object
  • Object
show all
Includes:
ItemBuilder::Modes
Defined in:
lib/item_builder/modes/simple_service.rb

Instance Attribute Summary

Attributes included from ItemBuilder::Modes

#bundles, #existing_alloc_stocks, #item_bundle_variants, #listing, #stock_allocs, #variant_listings, #variants, #wh_spaces

Instance Method Summary collapse

Methods included from ItemBuilder::Modes

#base, #initialize

Instance Method Details

#performObject



11
12
13
# File 'lib/item_builder/modes/simple_service.rb', line 11

def perform
  to_h.merge(base)
end

#priceObject



23
24
25
# File 'lib/item_builder/modes/simple_service.rb', line 23

def price
  PriceService.new(listing: listing).to_h
end

#quantityObject



19
20
21
# File 'lib/item_builder/modes/simple_service.rb', line 19

def quantity
  QuantityService.new(listing: listing).to_h
end

#to_hObject



15
16
17
# File 'lib/item_builder/modes/simple_service.rb', line 15

def to_h
  quantity.merge(price)
end