class SimpleAttribute::Attributes::Enumeration
Public Instance Methods
attribute_name()
click to toggle source
# File lib/simple_attribute/attributes/enumeration.rb, line 4 def attribute_name 'enumeration' end
label_method()
click to toggle source
# File lib/simple_attribute/attributes/enumeration.rb, line 8 def label_method @options.fetch(:label, :titleize) end
render()
click to toggle source
Calls superclass method
SimpleAttribute::Attributes::Base#render
# File lib/simple_attribute/attributes/enumeration.rb, line 12 def render values = @value.to_a.map(&:"#{label_method}") items = values.map { |item| @value = item; super } items.join.html_safe end