Class: OpportunityBriefing::QuoteParentChange
- Inherits:
-
Object
- Object
- OpportunityBriefing::QuoteParentChange
- Includes:
- SnapshotFormatting, Service
- Defined in:
- app/services/opportunity_briefing/quote_parent_change.rb
Overview
Summarizes the price and elapsed-time change from a quote's parent revision.
Defined Under Namespace
Classes: Result
Instance Method Summary collapse
Methods included from Service
#attributes_used, #build_result, call, #logger
Methods included from Service::Initializer
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'app/services/opportunity_briefing/quote_parent_change.rb', line 14 def call return Result.new unless quote.parent Result.new(data: { total: total_change, days_between_revisions: (quote.created_at.to_date - quote.parent.created_at.to_date).to_i }.compact) end |