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
- #false? ⇒ Boolean
- #falsey? ⇒ Boolean
- #not_false? ⇒ Boolean
- #not_falsey? ⇒ Boolean
- #not_true? ⇒ Boolean
- #not_truthy? ⇒ Boolean
- #true? ⇒ Boolean
- #truthy? ⇒ Boolean
Instance Method Details
#false? ⇒ Boolean
27 28 29 |
# File 'lib/truthiness.rb', line 27 def false? self == false end |
#falsey? ⇒ 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
31 32 33 |
# File 'lib/truthiness.rb', line 31 def not_false? !false? end |
#not_falsey? ⇒ Boolean
15 16 17 |
# File 'lib/truthiness.rb', line 15 def not_falsey? !falsey? end |
#not_true? ⇒ Boolean
23 24 25 |
# File 'lib/truthiness.rb', line 23 def not_true? !true? end |
#not_truthy? ⇒ Boolean
7 8 9 |
# File 'lib/truthiness.rb', line 7 def not_truthy? !truthy? end |
#true? ⇒ Boolean
19 20 21 |
# File 'lib/truthiness.rb', line 19 def true? self == true end |
#truthy? ⇒ Boolean
3 4 5 |
# File 'lib/truthiness.rb', line 3 def truthy? self.to_s.match(/true|yes|1/i) != nil end |