Class: ItemBuilderMwh::Modes::Price::JdService
- Defined in:
- lib/item_builder_mwh/modes/price/jd_service.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#initialize, #sale_price_policy
Constructor Details
This class inherits a constructor from ItemBuilderMwh::Modes::Price::Base
Instance Method Details
#jd_price ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/item_builder_mwh/modes/price/jd_service.rb', line 19 def jd_price increment_price = if (listing.price % 1000).positive? 1000 else 0 end (listing.price.to_i / 1000) * 1000 + increment_price end |
#perform ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/item_builder_mwh/modes/price/jd_service.rb', line 10 def perform { price: listing.price, sale_price: jd_price, sale_start_at: listing.sale_start_at, sale_end_at: listing.sale_end_at } end |