module Trueman

Constants

FALSE_VALUES
TRUE_VALUES
VERSION

Public Class Methods

false_values() click to toggle source
# File lib/trueman.rb, line 19
def self.false_values
  @@false_values ||= FALSE_VALUES
end
falsy?(value) click to toggle source
# File lib/trueman.rb, line 11
def self.falsy?(value)
  false_values.include? value
end
patch_object!() click to toggle source
# File lib/trueman.rb, line 23
def self.patch_object!
  Object.class_eval do
    def truthy?
      Trueman.truthy? self
    end unless self.class.respond_to?(:truthy?)

    def falsy?
      Trueman.falsy? self
    end unless self.class.respond_to?(:falsy?)
  end
end
true_values() click to toggle source
# File lib/trueman.rb, line 15
def self.true_values
  @@true_values ||= TRUE_VALUES
end
truthy?(value) click to toggle source
# File lib/trueman.rb, line 7
def self.truthy?(value)
  true_values.include? value
end

Public Instance Methods

falsy?() click to toggle source
# File lib/trueman.rb, line 29
def falsy?
  Trueman.falsy? self
end
truthy?() click to toggle source
# File lib/trueman.rb, line 25
def truthy?
  Trueman.truthy? self
end