Class: Activity::ResourceList::OrderFormatter

Inherits:
BaseFormatter
  • Object
show all
Defined in:
app/services/activity/resource_list.rb

Instance Attribute Summary

Attributes inherited from BaseFormatter

#record

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

#displayObject



218
219
220
# File 'app/services/activity/resource_list.rb', line 218

def display
  [reference_number, state, total, created_at].compact.join(' - ')
end

#ship_toObject



222
223
224
225
226
227
228
# File 'app/services/activity/resource_list.rb', line 222

def ship_to
  [
    shipping_address&.person_name,
    shipping_address&.city,
    shipping_address&.state_code
  ].compact.join(' ')
end

#totalObject



230
231
232
# File 'app/services/activity/resource_list.rb', line 230

def total
  Money.new((record.total || 0) * 100, record.currency).format
end