Class: Symphonia::ModelAttributes::EnumAttribute

Inherits:
Attribute
  • Object
show all
Defined in:
lib/symphonia/model_attributes/attribute.rb

Instance Attribute Summary

Attributes inherited from Attribute

#filter, #format_options, #name, #options, #sort_column

Instance Method Summary collapse

Methods inherited from Attribute

#default?, #filter?, #format, #initialize, #required?, #sort=, #sort?, #title, #value

Constructor Details

This class inherits a constructor from Symphonia::ModelAttributes::Attribute

Instance Method Details

#format_value(view, value, _entity) ⇒ Object

TODO: @klass.name || @klass.base_class.name || entity.class.name



108
109
110
# File 'lib/symphonia/model_attributes/attribute.rb', line 108

def format_value(view, value, _entity)
  view.t("#{@klass.name.underscore}.#{name.to_s.pluralize}.#{value}", **format_options)
end

#input_fieldObject



112
113
114
# File 'lib/symphonia/model_attributes/attribute.rb', line 112

def input_field
  :select
end

#input_optionsObject



116
117
118
# File 'lib/symphonia/model_attributes/attribute.rb', line 116

def input_options
  []
end