Class: OpportunityBriefing::QuoteLineItemSnapshot

Inherits:
Object
  • Object
show all
Includes:
SnapshotFormatting, Service
Defined in:
app/services/opportunity_briefing/quote_line_item_snapshot.rb

Overview

Serializes the focused quote's bounded line-item list.

Defined Under Namespace

Classes: Result

Constant Summary collapse

LIMIT =
25

Instance Method Summary collapse

Methods included from Service

#attributes_used, #build_result, call, #logger

Methods included from Service::Initializer

#initialize

Instance Method Details

#callObject



16
17
18
19
20
21
22
23
# File 'app/services/opportunity_briefing/quote_line_item_snapshot.rb', line 16

def call
  return Result.new(count: count_data(0, 0, LIMIT)) unless quote

  Result.new(
    items: items,
    count: count_data(items.size, scope.count, LIMIT)
  )
end