Create a gist now

Instantly share code, notes, and snippets.

@DNNX /answer.rb Secret
Created Apr 16, 2017

What would you like to do?
excellent-7-fix
MyClass = Class.new { def ===(_); rand < 0.5; end }.new
# Who said `MyClass` should be a class? Principle of least surprise, remember!
@pirj

This comment has been minimized.

Show comment Hide comment
@pirj

pirj May 18, 2017

I thought of class MyClass; def self.===(_); @x=!@x; end; end

pirj commented May 18, 2017

I thought of class MyClass; def self.===(_); @x=!@x; end; end

@DNNX

This comment has been minimized.

Show comment Hide comment
@DNNX

DNNX Jun 28, 2017

yep, this is even better

Owner

DNNX commented Jun 28, 2017

yep, this is even better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment