Christopher Dicely
3/13/2008 2:08:00 AM
On Wed, Mar 12, 2008 at 10:17 AM, Mario Ruiz <mario@betware.com> wrote:
> so it's impossible to do it whithout declaring a method...
That depends what you want, which isn't clear. If you don't need to change the
values (and even if you do, since the constant-ness of Ruby constants isn't
enforced, though using them when you don't want something constant is
usually bad design), you can do without methods:
file:scenarios.rb
------------------
module Scenarios
module Default
BAB ="defaultmodulevalue"
end
module DefaultHidden
BAB ="hiddenmodulevalue"
end
module DefaultSecond
BAB ="secondmodulevalue"
end
end
file:mytest.rb
---------------
require 'scenarios.rb'
include Scenarios::Default
...
puts BAB
--------------