Dynamically generate prefixes for method names
<p>Let's say we have a bunch of methods with typical prefixes.</p>

<pre><code>def pref_foo
  # code
end

def pref_bar
  # code
end
</code></pre>

<p>I want to learn how to automatically prepend those prefixes to my method names (like how it's done in Rails: <code>Model.find_by_smth</code>). </p>

<p>In other words I want to create some scope <code>pref_</code>, that takes methods and prepends <code>pref_</code> to their names, so my method <code>foo</code> is becoming available as <code>pref_foo</code>.</p>

<hr>

<pre><code>module Bar
  # definition of some wrapper `pref_`
end

class Foo
  include Bar

  &lt;some wrapper from Bar&gt; do
    def foo
      puts 'What does a computer scientist wear on Halloween?'
    end

    def bar
      puts 'A bit-mask.'
    end
  end
end

foo = Foo.new

foo.pref_foo # =&gt; "What does a computer scientist wear on Halloween?"
foo.pref_bar # =&gt; "A bit-mask."
</code></pre>