Class: RailsSettingsUi::ValueTypes::Boolean

Inherits:
Base
  • Object
show all
Defined in:
lib/rails-settings-ui/value_types/boolean.rb

Instance Attribute Summary

Attributes inherited from Base

#errors, #value

Instance Method Summary collapse

Methods inherited from Base

#initialize, #valid?, #value_numeric?

Constructor Details

This class inherits a constructor from RailsSettingsUi::ValueTypes::Base

Instance Method Details

#castObject



6
7
8
9
10
11
12
13
# File 'lib/rails-settings-ui/value_types/boolean.rb', line 6

def cast
  case value
  when 'off'
    self.value = false
  else
    self.value = true
  end
end