Class: Symphonia::ModelAttributes::EnumAttribute

Inherits:
Attribute 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



101
102
103
# File 'lib/symphonia/model_attributes/attribute.rb', line 101

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

#input_fieldObject



105
106
107
# File 'lib/symphonia/model_attributes/attribute.rb', line 105

def input_field
  :select
end

#input_optionsObject



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

def input_options
  []
end