Open
Description
# without config.predicates_return false
NullObject = Naught.build do |config|
def coerce(other)
[0, other]
end
end
null = NullObject.new;
1 / null # => 0
# with config.predicates_return false
NullObject = Naught.build do |config|
config.predicates_return false
def coerce(other)
[0, other]
end
end
null = NullObject.new;
1 / null # => NullObject can't be coerced into Fixnum
Activity