On Mon, Oct 13, 2008 at 02:35, Tarmo Tänav <[EMAIL PROTECTED]> wrote:

>
> Any ideas on how to make that work?


The method could overwrite itself on first call.

module Test
  def self.env
    e = 'production'
    def self.env() 'development' end
    e
  end
end

Test.env # => 'production'
Test.env # => 'development'

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to