Class: Activity::ResourceList::BaseFormatter
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Activity::ResourceList::BaseFormatter
- Defined in:
- app/services/activity/resource_list.rb
Overview
All Formatters are used to format the display in the select list.
Direct Known Subclasses
CreditMemoFormatter, InvoiceFormatter, OpportunityFormatter, OrderFormatter, PurchaseOrderFormatter, QuoteFormatter, RmaFormatter, RoomConfigurationFormatter, SupportCaseFormatter
Instance Attribute Summary collapse
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
- #created_at ⇒ Object
- #display ⇒ Object
- #identifier ⇒ Object
-
#initialize(record) ⇒ BaseFormatter
constructor
A new instance of BaseFormatter.
- #state ⇒ Object
Constructor Details
#initialize(record) ⇒ BaseFormatter
Returns a new instance of BaseFormatter.
200 201 202 203 |
# File 'app/services/activity/resource_list.rb', line 200 def initialize(record) @record = record super(@record) end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record.
198 199 200 |
# File 'app/services/activity/resource_list.rb', line 198 def record @record end |
Instance Method Details
#created_at ⇒ Object
213 214 215 |
# File 'app/services/activity/resource_list.rb', line 213 def created_at record.created_at&.to_fs(:crm_date_only) end |
#display ⇒ Object
205 206 207 |
# File 'app/services/activity/resource_list.rb', line 205 def display record.to_s end |
#identifier ⇒ Object
209 210 211 |
# File 'app/services/activity/resource_list.rb', line 209 def identifier record.to_gid.to_s end |
#state ⇒ Object
217 218 219 |
# File 'app/services/activity/resource_list.rb', line 217 def state record.human_state_name end |