Class: HasSetting::Formatters::StrictBooleanFormatter

Inherits:
NilSafeFormatter show all
Defined in:
lib/has_setting/formatters.rb

Instance Method Summary collapse

Methods inherited from NilSafeFormatter

#to_s, #to_type

Instance Method Details

#safe_to_s(value) ⇒ Object



70
71
72
# File 'lib/has_setting/formatters.rb', line 70

def safe_to_s(value)
  value ? '1' : '0'
end

#safe_to_type(value) ⇒ Object



67
68
69
# File 'lib/has_setting/formatters.rb', line 67

def safe_to_type(value)
  value == '1'
end