class Nullz::NullObject

Public Instance Methods

!=(value) click to toggle source
# File lib/null_object.rb, line 60
def !=(value)
  !value.nil?
end
&(_value)
Alias for: return_null_object
*(_value)
Alias for: return_null_object
+(_value)
Alias for: return_null_object
-(_value)
Alias for: return_null_object
/(_value)
Alias for: return_null_object
<(_value) click to toggle source
# File lib/null_object.rb, line 95
def <(_value)
  return false
end
<<(_value)
Alias for: return_null_object
==(value) click to toggle source
# File lib/null_object.rb, line 56
def ==(value)
  value.nil?
end
>(_value) click to toggle source
# File lib/null_object.rb, line 91
def >(_value)
  return false
end
>>(_value)
Alias for: return_null_object
[](_value)
Alias for: return_null_object
^(_value)
Alias for: return_null_object
coerce(value) click to toggle source
# File lib/null_object.rb, line 36
def coerce(value)
  [NullObject.new, value]
end
empty?() click to toggle source
# File lib/null_object.rb, line 99
def empty?
  true
end
inspect() click to toggle source
# File lib/null_object.rb, line 28
def inspect
  nil.inspect
end
method_missing(method, *_args, &_block) click to toggle source
# File lib/null_object.rb, line 111
def method_missing(method, *_args, &_block)
  return false if method.to_s.index('?')
  NullObject.new unless method == :to_ary
end
nil?() click to toggle source
# File lib/null_object.rb, line 103
def nil?
  true
end
null?() click to toggle source
# File lib/null_object.rb, line 107
def null?
  true
end
rationalize() click to toggle source
# File lib/null_object.rb, line 32
def rationalize
  nil.rationalize
end
return_null_object(_value) click to toggle source
# File lib/null_object.rb, line 40
def return_null_object(_value)
  NullObject.new
end
Also aliased as: +, -, *, /, |, ^, ~, &, [], <<, >>
to_b() click to toggle source
# File lib/null_object.rb, line 84
def to_b
  false
end
Also aliased as: to_bool
to_bool()
Alias for: to_b
to_c() click to toggle source
# File lib/null_object.rb, line 80
def to_c
  nil.to_c
end
to_f() click to toggle source
# File lib/null_object.rb, line 68
def to_f
  nil.to_f
end
to_i() click to toggle source
# File lib/null_object.rb, line 72
def to_i
  nil.to_i
end
to_r() click to toggle source
# File lib/null_object.rb, line 64
def to_r
  nil.to_r
end
to_s() click to toggle source
# File lib/null_object.rb, line 76
def to_s
  nil.to_s
end
Also aliased as: to_str
to_str()
Alias for: to_s
|(_value)
Alias for: return_null_object
~(_value)
Alias for: return_null_object