Class: ErpRules::RulesEngine::PricingEngine

Inherits:
Object
  • Object
show all
Defined in:
lib/erp_rules/rules_engine/pricing_engine.rb

Instance Method Summary collapse

Constructor Details

#initializePricingEngine

Returns a new instance of PricingEngine.



5
6
# File 'lib/erp_rules/rules_engine/pricing_engine.rb', line 5

def initialize()
end

Instance Method Details

#price_products(execution_context) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/erp_rules/rules_engine/pricing_engine.rb', line 8

def price_products(execution_context)
  execution_context[:product_context][:products].each do |product|
    pricing_plan = PricingPlan.find_by_internal_identifier('default')
    product[:price] = pricing_plan.get_price()
  end

  execution_context
end