title: Ruby: trying to object.send a module function with parameters
body: <p>I have a module that has a function defined within:</p>
  
  <pre><code>module Settings
  def find_by_name(name, start)
    puts "find_by_name: Found me!"
  end
  </code></pre>
  
  <p>In miniTest I'm trying to test "sending" to this function in a manner that simulates it dynamically being defined/called at runtime.  Here's what I'm trying to do in MiniTest.</p>
  
  <pre><code>require 'settings'
  
  class TestFileUtilities &lt; MiniTest::Unit::TestCase
  
    def test_dynamic_call_to_Settings
      foreign_function = 'Settings::find_by_name'
      send(foreign_function, 'name.txt', 'Users/MCP/Desktop/Projects/TestDir')
    end
  </code></pre>
  
  <p>What I am expecting is that send() will call the "foreign_function" method, converting the string to a symbol, and then will add the two parameters to the call.  All I want is no errors, and a puts to my console so that I know it's working...then I'll start defining "assertions".  Right now though I get:</p>
  
  <pre><code>NoMethodError: undefined method `Settings::find_by_name' for #&lt;TestFileUtilities:0x007fdf59840310&gt;
  </code></pre>
  
  <p>This is the first time I'm playing around with Ruby's ability to dynamically call methods and I was able to get it to work when I wasn't using the scope resolution operator and was <code>include Settings</code> inside of <code>TestFileUtilities</code> but I'd rather use scope so that user defined functions don't conflict with anything inside of my class (not just conflict with MiniTest, but the actual FileUtilities class).  Any thoughts/help would be greatly apprecaited!  For anyone who's stumbled here looking for info, <a href="http://khelll.com/blog/ruby/ruby-dynamic-method-calling/" rel="nofollow">this</a> is what got me started. </p>