public
Description: Easily find out the truthiness of any Ruby object.
Homepage:
Clone URL: git://github.com/ymendel/truthy.git
Click here to lend your support to: truthy and make a donation at www.pledgie.com !
truthy / README.txt
100644 32 lines (20 sloc) 0.71 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
= truthy
 
== DESCRIPTION:
 
This gem is to make it easier to discover the truth values of various Ruby
objects. Ask any object if it is truthy, and it will tell you.
 
== SYNOPSIS:
 
    require 'truthy'
    
    true.truthy? # => true
    false.truthy? # => false
    nil.truthy? # => false
    
    [].truthy? # => true
    [nil].truthy? # => true
    %w[one two three].truthy? # => true
    
    {}.truthy? # => true
    { 'one' => 1 }.truthy? # => true
    
    ''.truthy? # => true
    ' '.truthy? # => true
    'hello'.truthy? # => true
 
The possibilities are endless.
 
== INSTALL:
 
* sudo gem install truthy