title: Rails: I can't call a function in a module in /lib - what am I doing wrong?
body: <p>I have a module saved in /lib as test_functions.rb that looks like this</p>
  <pre><code>module TestFunctions
    def abc
      puts 123
    end
  end
  </code></pre>
  <p>Going into ruby script/runner, I can see that the module is loading automatically (good ol' convention over configuration and all that...)</p>
  <pre><code>&gt;&gt; TestFunctions.instance_methods
  =&gt; [&quot;abc&quot;]
  </code></pre>
  <p>so the method is known, let's try calling it</p>
  <pre><code>&gt;&gt; TestFunctions.abc
  NoMethodError: undefined method `abc' for TestFunctions:Module from (irb):3
  </code></pre>
  <p>Nope. How about this?</p>
  <pre><code>&gt;&gt; TestFunctions::abc
  NoMethodError: undefined method `abc' for TestFunctions:Module from (irb):4
  </code></pre>
  <p>Test
  Nope again.</p>
  <pre><code>defined?(TestFunctions::abc) #=&gt; nil, but
  TestFunctions.method_defined? :abc #=&gt; true
  </code></pre>
  <p>Like I said at the top, I know I'm being dumb, can anyone de-dumb me?</p>