class NilClass
Adds a couple of methods in NilClass
and modifies the behaviour +==+ slightly so that it returns true for nil-equivalent objects if they return true for nil?
In default, it seems the judgement is based on +other.__id__+. Note that the method eql?
(and of course equal?
) unchange.
Here is the summary of the changes:
-
{NilClass#nowhere?} is added, which returns
false
. -
{NilClass#class_raw} is added, which returns {NilClass}
-
+(nil == RangeExtd::Nowhere::NOWHERE)+ returns
true
To activate these features, explicitly do either of the following
require "range_extd/nil_class" require "range_extd/load_all"
Public Instance Methods
==(other)
click to toggle source
returns true if other returns true with nil?
.
@return [Boolean]
# File lib/range_extd/nil_class.rb, line 36 def ==(other) other.nil? end
Also aliased as: double_equals?
class_raw()
click to toggle source
Identical to nil.class
@return [Class]
# File lib/range_extd/nil_class.rb, line 27 def class_raw self.class end
nowhere?()
click to toggle source
returns true
# File lib/range_extd/nil_class.rb, line 20 def nowhere? false end