2024-10-30 09:23:44 -04:00
|
|
|
class Security::SynthComboboxOption
|
|
|
|
include ActiveModel::Model
|
|
|
|
|
2025-02-11 10:40:30 -06:00
|
|
|
attr_accessor :symbol, :name, :logo_url, :exchange_acronym, :exchange_country_code, :exchange_operating_mic
|
2024-10-30 09:23:44 -04:00
|
|
|
|
|
|
|
def id
|
2025-02-11 10:40:30 -06:00
|
|
|
"#{symbol}|#{exchange_operating_mic}" # submitted by combobox as value
|
2024-10-30 09:23:44 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def to_combobox_display
|
2025-02-11 10:40:30 -06:00
|
|
|
display_code = exchange_acronym.presence || exchange_operating_mic
|
|
|
|
"#{symbol} - #{name} (#{display_code})" # shown in combobox input when selected
|
2024-10-30 09:23:44 -04:00
|
|
|
end
|
|
|
|
end
|