Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby
498 B
Raw Blame
class Security::ComboboxOption
  include ActiveModel::Model

  attr_accessor :symbol, :name, :logo_url, :exchange_operating_mic, :country_code, :price_provider, :currency, :isin

  def id
    "#{symbol}|#{exchange_operating_mic}|#{price_provider}"
  end

  def exchange_name
    Security.exchange_name_for(exchange_operating_mic)
  end

  def to_combobox_display
    I18n.t(
      "securities.combobox.display",
      symbol: symbol,
      name: name,
      exchange: exchange_name
    )
  end
end