class CodeKindly::Utils::Boolean
Constants
- FALSES
- TRUES
modified from ActiveRecord::ConnectionAdapters::Column (4.2.9)
Public Class Methods
false?(value)
click to toggle source
# File lib/code_kindly/utils/boolean.rb, line 21 def false?(value) return true if FALSES.include?(value) if value.respond_to?(:downcase) return true if FALSES.include?(value.downcase) end false end
from(value)
click to toggle source
# File lib/code_kindly/utils/boolean.rb, line 15 def from(value) return true if true?(value) return false if false?(value) nil end
is_false?(value)
click to toggle source
# File lib/code_kindly/utils/boolean.rb, line 37 def is_false?(value) deprecate :is_false?, :false?, :'0.1.0' false?(value) end
is_true?(value)
click to toggle source
# File lib/code_kindly/utils/boolean.rb, line 42 def is_true?(value) deprecate :is_true?, :true?, :'0.1.0' true?(value) end
true?(value)
click to toggle source
# File lib/code_kindly/utils/boolean.rb, line 29 def true?(value) return true if TRUES.include?(value) if value.respond_to?(:downcase) return true if TRUES.include?(value.downcase) end false end