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.
189 190 191 192 |
# File 'app/services/activity/resource_list.rb', line 189 def initialize(record) @record = record super(@record) end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record.
187 188 189 |
# File 'app/services/activity/resource_list.rb', line 187 def record @record end |
Instance Method Details
#created_at ⇒ Object
202 203 204 |
# File 'app/services/activity/resource_list.rb', line 202 def created_at record.created_at&.to_fs(:crm_date_only) end |
#display ⇒ Object
194 195 196 |
# File 'app/services/activity/resource_list.rb', line 194 def display record.to_s end |
#identifier ⇒ Object
198 199 200 |
# File 'app/services/activity/resource_list.rb', line 198 def identifier record.to_gid.to_s end |
#state ⇒ Object
206 207 208 |
# File 'app/services/activity/resource_list.rb', line 206 def state record.human_state_name end |