Module: Truthiness

Included in:
Object
Defined in:
lib/truthiness.rb,
lib/truthiness/version.rb

Constant Summary collapse

VERSION =
"0.1.1"

Instance Method Summary collapse

Instance Method Details

#false?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/truthiness.rb', line 27

def false?
  self == false
end

#falsey?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/truthiness.rb', line 11

def falsey?
  self.to_s.match(/false|no|0/i) != nil
end

#not_false?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/truthiness.rb', line 31

def not_false?
  !false?
end

#not_falsey?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/truthiness.rb', line 15

def not_falsey?
  !falsey?
end

#not_true?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/truthiness.rb', line 23

def not_true?
  !true?
end

#not_truthy?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/truthiness.rb', line 7

def not_truthy?
  !truthy?
end

#true?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/truthiness.rb', line 19

def true?
  self == true
end

#truthy?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/truthiness.rb', line 3

def truthy?
  self.to_s.match(/true|yes|1/i) != nil
end