Ruby enthusiasts! I am trying to write a DSL in ruby and i would like to be able to create some magic methods (not sure that is the most accurate term for what i want).
I would like to be able to do things like the following: a = [1, 2, 3] b = 2
(a contains b)
And have it resolve to true or false.
Essentially, how can i define the function "contains" so that it takes an array "a" and a variable "b" and performs a.contains?(b), but without all of the associated ruby-specific syntax?