Skip to content

Instantly share code, notes, and snippets.

@Killavus
Created September 24, 2015 09:45
Show Gist options
  • Save Killavus/29fa777bf8e10265847f to your computer and use it in GitHub Desktop.
Save Killavus/29fa777bf8e10265847f to your computer and use it in GitHub Desktop.
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)
@Killavus
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment