Do type conversion on values that could be boolen values into real 'true' or 'false'
This is pulled from the possible boolean values from PostgreSQL
list of downcased strings are potential false values
# File lib/amalgalite/boolean.rb, line 24 def false_values @false_values ||= ] false f no n 0 ] end
Convert val to a string and attempt to convert it to true or false
# File lib/amalgalite/boolean.rb, line 31 def to_bool( val ) return false if val.nil? unless defined? @to_bool @to_bool = {} true_values.each { |t| @to_bool[t] = true } false_values.each { |f| @to_bool[f] = false } end return @to_bool[val.to_s.downcase] end
Generated with the Darkfish Rdoc Generator 2.