Module: Golden::Setting::FormOption
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #field_type ⇒ Object
- #field_type=(new_value) ⇒ Object
- #field_values ⇒ Object
- #field_values=(new_value) ⇒ Object
- #form_options ⇒ Object
Instance Method Details
#field_type ⇒ Object
40 41 42 |
# File 'lib/golden/setting/form_option.rb', line 40 def field_type [:type] end |
#field_type=(new_value) ⇒ Object
44 45 46 47 |
# File 'lib/golden/setting/form_option.rb', line 44 def field_type= new_value return unless new_value self.[:type] = new_value.to_sym end |
#field_values ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/golden/setting/form_option.rb', line 49 def field_values case [:collection] when String eval [:collection] else [:collection] end end |
#field_values=(new_value) ⇒ Object
58 59 60 61 |
# File 'lib/golden/setting/form_option.rb', line 58 def field_values= new_value return unless new_value self.[:collection] = eval(new_value) end |
#form_options ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/golden/setting/form_option.rb', line 29 def case self[:form_options] when String YAML::load self[:form_options] when Hash super else self[:form_options] = .dup end end |