Skip to content

Instantly share code, notes, and snippets.

@ukstv
Created September 26, 2013 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ukstv/6712834 to your computer and use it in GitHub Desktop.
Save ukstv/6712834 to your computer and use it in GitHub Desktop.
class EnumType < DelegateClass(Symbol)
# ...
end
Symbol.instance_eval do
def ===(other)
if other.kind_of?(EnumType)
true
else
super(other)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment