transparent_nil 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/README.txt +14 -4
  2. data/lib/transparent_nil.rb +1 -1
  3. metadata +1 -1
data/README.txt CHANGED
@@ -7,17 +7,27 @@ nil values can be quite annoying. Although it is a nice error indicator but you'
7
7
  gets ugly with too many conditional statements that handle the nil case.
8
8
   
9
9
  TransparentNil defines some methods for +nil+ so nil values behave like any other object. Most of them return just nil, but some are different:
10
+
11
+ nil.dup
12
+ => nil
13
+
14
+ nil[2]
15
+ => nil
16
+
10
17
  nil.empty?
11
- > true
18
+ => true
12
19
 
13
20
  nil << [element]
14
- > [element]
21
+ => [[element]]
15
22
 
16
23
  nil.size
17
- > 0
24
+ => 0
18
25
 
19
26
  nil.split(//)
20
- > []
27
+ => []
28
+
29
+ nil <=> 1
30
+ => nil
21
31
 
22
32
  Think +nil+ als "nothing". You can ask for nil if you need to, but you don't have to do it so often.
23
33
 
@@ -10,7 +10,7 @@ puts 'Using TransparentNil'
10
10
 
11
11
  module TransparentNil #:nodoc
12
12
 
13
- VERSION = '0.1.4'
13
+ VERSION = '0.1.5'
14
14
 
15
15
  end
16
16
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transparent_nil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: