class NullObject

Null object [en.wikipedia.org/wiki/Null_Object_pattern]

Public Instance Methods

==(other) click to toggle source
# File lib/maybe_null/null_object.rb, line 52
def ==(other)
  other.is_a?(self.class)
end
blank?() click to toggle source
# File lib/maybe_null/null_object.rb, line 18
def blank?
  true
end
method_missing(*args, &block) click to toggle source

@return [NullObject]

# File lib/maybe_null/null_object.rb, line 6
def method_missing(*args, &block)
  self
end
nil?() click to toggle source
# File lib/maybe_null/null_object.rb, line 14
def nil?
  true
end
presence() click to toggle source

@return [NilClass]

# File lib/maybe_null/null_object.rb, line 27
def presence
  nil
end
present?() click to toggle source
# File lib/maybe_null/null_object.rb, line 22
def present?
  false
end
respond_to?(*args) click to toggle source
# File lib/maybe_null/null_object.rb, line 10
def respond_to?(*args)
  true
end
to_a() click to toggle source

@return [Array]

# File lib/maybe_null/null_object.rb, line 32
def to_a; [] end
to_boolean() click to toggle source

@return [Boolean]

# File lib/maybe_null/null_object.rb, line 47
def to_boolean; false end
to_f() click to toggle source

@return [Float]

# File lib/maybe_null/null_object.rb, line 38
def to_f; 0.0 end
to_hash() click to toggle source

@return [Hash]

# File lib/maybe_null/null_object.rb, line 50
def to_hash; {} end
to_i() click to toggle source

@return [Integer]

# File lib/maybe_null/null_object.rb, line 41
def to_i; 0 end
to_int() click to toggle source

@return [Integer]

# File lib/maybe_null/null_object.rb, line 44
def to_int; 0 end
to_s() click to toggle source

@return [String]

# File lib/maybe_null/null_object.rb, line 35
def to_s; "" end