Class: SettrSetting

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/settr_setting.rb

Instance Method Summary collapse

Instance Method Details

#options=(opts) ⇒ Object



23
24
25
# File 'app/models/settr_setting.rb', line 23

def options=(opts)
  write_attribute :options, opts.gsub(' ','').gsub(',', ', ')
end

#select?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/models/settr_setting.rb', line 19

def select?
  typ == 'select'
end

#valObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/models/settr_setting.rb', line 6

def val
  case typ
    when 'boolean'
      value == 'true'
    when 'float'
      value.to_f
    when 'integer'
      value.to_i
    else
      value
  end
end