Class: Activity::ResourceList::QuoteFormatter
- Inherits:
-
BaseFormatter
- Object
- SimpleDelegator
- BaseFormatter
- Activity::ResourceList::QuoteFormatter
- Defined in:
- app/services/activity/resource_list.rb
Overview
Service object: quote formatter.
Instance Attribute Summary
Attributes inherited from BaseFormatter
Instance Method Summary collapse
-
#display ⇒ String
Option label: reference, state, total, opportunity name, and date.
-
#total ⇒ String
Formatted quote total.
Methods inherited from BaseFormatter
#created_at, #identifier, #initialize, #state
Constructor Details
This class inherits a constructor from Activity::ResourceList::BaseFormatter
Instance Method Details
#display ⇒ String
Option label: reference, state, total, opportunity name, and date.
318 319 320 |
# File 'app/services/activity/resource_list.rb', line 318 def display [reference_number, state, total, opportunity&.name, created_at].compact.join(' - ') end |
#total ⇒ String
Formatted quote total.
324 325 326 |
# File 'app/services/activity/resource_list.rb', line 324 def total Money.new((record.total || 0) * 100, record.currency).format end |