⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (335 Bytes)
Bug #14719
» simple_delegator_on_boolean_with_equals_override.rb
theirishpenguin (Declan McGrath)
, 04/27/2018 04:16 PM
#!/usr/bin/env ruby
class
BoldBool
<
SimpleDelegator
def
equal?
(
obj
)
if
__getobj__
.
is_a?
FalseClass
and
obj
==
false
return
true
else
__getobj__
.
equal?
(
obj
)
end
end
end
false_bool
=
BoldBool
.
new
(
false
)
if
false_bool
puts
"I'm evaluated as true but I should be false."
end
« Previous
1
2
3
Next »
(2-2/3)
Loading...