I want to create a bunch of methods for a find_by feature. I don\'t want to write the same thing over and over again so I want to use metaprogramming.
Say I want to
It if you read the examples here http://apidock.com/ruby/Module/define_method you will find this one:
define_method(:my_method) do |foo, bar| # or even |*args| # do something end
is the same as
def my_method(foo, bar) # do something end