title: Dynamic Method Call within define_method
body: <p>I'm rather new to ruby, but am in a situation where I have many repetitive methods. In attempting to DRY out my code I came up with something like the following:</p>
  
  <pre><code>class Foobar
    def some_method
      #
    end
  
    def some_method2
      #
    end
  
    def some_calculation
      #
    end
  
    [:some_method_test, :some_method2_test].each do |method|
      define_method method do
        return self.send(method.to_s.chomp "_test") / some_calculation
      end
    end
  end
  </code></pre>
  
  <p>My question is regarding the .to_s.comp-- is there another way of writing this and accomplishing my goal?</p>