mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
24 lines
467 B
Ruby
24 lines
467 B
Ruby
class Api::CurrencyConfigSerializer < ActiveModel::Serializer
|
|
attributes :currency, :display_currency, :symbol, :symbol_position, :hide_cents
|
|
|
|
def currency
|
|
Spree::Config[:currency]
|
|
end
|
|
|
|
def display_currency
|
|
Spree::Config[:display_currency]
|
|
end
|
|
|
|
def symbol
|
|
::Money.new(1, Spree::Config[:currency]).symbol
|
|
end
|
|
|
|
def symbol_position
|
|
Spree::Config[:currency_symbol_position]
|
|
end
|
|
|
|
def hide_cents
|
|
Spree::Config[:hide_cents]
|
|
end
|
|
end
|