Class: Avo::Fields::CurrencyField
- Defined in:
- lib/avo/fields/currency_field.rb
Instance Attribute Summary collapse
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
Attributes inherited from BaseField
#action, #as_avatar, #as_description, #as_label, #block, #computable, #computed, #computed_value, #default, #format_using, #help, #id, #model, #null_values, #nullable, #panel_name, #readonly, #required, #resource, #sortable, #updatable, #user, #view, #visible
Attributes included from FieldExtensions::VisibleInDifferentViews
#show_on_edit, #show_on_index, #show_on_new, #show_on_show
Instance Method Summary collapse
-
#initialize(id, **args, &block) ⇒ CurrencyField
constructor
A new instance of CurrencyField.
Methods inherited from BaseField
#component_for_view, #custom?, #database_id, #fill_field, #has_own_panel?, #hydrate, #model_errors, #name, #placeholder, #resolve_attribute, #to_permitted_param, #translation_key, #type, #value, #view_component_name, #visible?
Methods included from FieldExtensions::HasFieldName
Methods included from FieldExtensions::VisibleInDifferentViews
#except_on, #hide_on, #only_on, #show_on
Constructor Details
#initialize(id, **args, &block) ⇒ CurrencyField
Returns a new instance of CurrencyField.
7 8 9 10 11 12 |
# File 'lib/avo/fields/currency_field.rb', line 7 def initialize(id, **args, &block) super(id, **args, &block) @currency = args[:currency].present? ? args[:currency].to_s : Avo.configuration.currency @locale = args[:locale].present? ? args[:locale].to_s : Avo.configuration.locale end |
Instance Attribute Details
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
4 5 6 |
# File 'lib/avo/fields/currency_field.rb', line 4 def currency @currency end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
5 6 7 |
# File 'lib/avo/fields/currency_field.rb', line 5 def locale @locale end |