Class: Activity::ResourceList::OrderFormatter
- Inherits:
-
BaseFormatter
- Object
- SimpleDelegator
- BaseFormatter
- Activity::ResourceList::OrderFormatter
- Defined in:
- app/services/activity/resource_list.rb
Overview
Service object: order formatter.
Instance Attribute Summary
Attributes inherited from BaseFormatter
Instance Method Summary collapse
Methods inherited from BaseFormatter
#created_at, #identifier, #initialize, #state
Constructor Details
This class inherits a constructor from Activity::ResourceList::BaseFormatter
Instance Method Details
#display ⇒ Object
231 232 233 |
# File 'app/services/activity/resource_list.rb', line 231 def display [reference_number, state, total, created_at].compact.join(' - ') end |
#ship_to ⇒ Object
235 236 237 238 239 240 241 |
# File 'app/services/activity/resource_list.rb', line 235 def ship_to [ shipping_address&.person_name, shipping_address&.city, shipping_address&.state_code ].compact.join(' ') end |
#total ⇒ Object
243 244 245 |
# File 'app/services/activity/resource_list.rb', line 243 def total Money.new((record.total || 0) * 100, record.currency).format end |