Created
September 24, 2015 09:45
-
-
Save Killavus/29fa777bf8e10265847f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PrepareCalculationForB2BManager | |
def prepare(quotation) | |
CalculationForB2BManager.new( | |
quotation.yearly_premium_value, | |
quotation.yearly_offer_number, | |
quotation.yearly_premium_url, | |
quotation.position_in_leads, | |
quotation.token, | |
quotation.save_quote_key, | |
quotation.competitors | |
) | |
end | |
end | |
CalculationForB2BManager = Struct.new(:calculated_price, | |
:yearly_offer_number, | |
:yearly_premium_url, | |
:position_in_leads, | |
:quotation_token, | |
:save_quote_key, | |
:competitors) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In your code:
unless q.blank?
calc = PrepareCalculationForB2BManager.new.prepare(q)
debug_store.write_req_to_b2b(partner.code, Time.now, calc.inspect)
else
# handle errors
end