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 ⇒ String?
Creation date formatted for the option label.
-
#display ⇒ String
Option label for the select list.
-
#identifier ⇒ String
Option value for the select list: the record's GlobalID.
- #initialize(record) ⇒ void constructor
-
#state ⇒ String
Human-readable state for the option label.
Constructor Details
#initialize(record) ⇒ void
250 251 252 253 |
# File 'app/services/activity/resource_list.rb', line 250 def initialize(record) @record = record super(@record) end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record.
246 247 248 |
# File 'app/services/activity/resource_list.rb', line 246 def record @record end |
Instance Method Details
#created_at ⇒ String?
Creation date formatted for the option label.
269 270 271 |
# File 'app/services/activity/resource_list.rb', line 269 def created_at record.created_at&.to_fs(:crm_date_only) end |
#display ⇒ String
Option label for the select list.
257 258 259 |
# File 'app/services/activity/resource_list.rb', line 257 def display record.to_s end |
#identifier ⇒ String
Option value for the select list: the record's GlobalID.
263 264 265 |
# File 'app/services/activity/resource_list.rb', line 263 def identifier record.to_gid.to_s end |
#state ⇒ String
Human-readable state for the option label.
275 276 277 |
# File 'app/services/activity/resource_list.rb', line 275 def state record.human_state_name end |