title: Trying to implement a Module using namespaces
body: <p>I am using Ruby on Rails 3 and I am trying to implement a Module using namespaces.</p>
  
  <p>In my <code>lib/</code> folder I have the <code>authorization.rb</code> file with in this:</p>
  
  <pre><code>module Authorizations
    def Authorizations.message
      return "flash_message"
    end
  end
  </code></pre>
  
  <p>In my controller I have:</p>
  
  <pre><code>class Users::AccountsController &lt; ApplicationController # 'Users' is the namespace
    include Authorizations
  
    def create
      ...
      flash.now[:notice] =  Authorizations.message
    end
  end
  </code></pre>
  
  <p>When I run the <code>create</code> method I get this error:</p>
  
  <pre><code>NoMethodError (undefined method 'message' for Authorizations:Module)
  </code></pre>
  
  <p><strong>What is wrong?</strong></p>
  
  <hr>
  
  <p>In the module statement I also tryed these</p>
  
  <pre><code>def Authorizations::message
   ...
  
  # or 
  
  def message
    ...
  </code></pre>
  
  <p>and also those don't work.</p>