Class: ConfigBoolean

Inherits:
ConfigString show all
Defined in:
lib/helpers.rb

Instance Method Summary collapse

Methods inherited from ConfigString

#add, #clear, #initialize, #name, #set, #to_s, #value

Constructor Details

This class inherits a constructor from ConfigString

Instance Method Details

#check(value) ⇒ Object



113
114
115
116
117
118
119
# File 'lib/helpers.rb', line 113

def check(value)
  if value == true or value == false then
    value
  else
    value.downcase == "yes"
  end
end

#format(value) ⇒ Object



121
122
123
# File 'lib/helpers.rb', line 121

def format(value)
  if value then "yes" else "no" end
end