Just as an update, I had bugs in the previous code provided and fixed with
help from Jesús Gabriel y Galán and Calvin B. on the list in this post:
http://www.ruby-forum.com/topic/4406183
module MyModule
class self
attr_accessor :debug, :proc_or_lambda, :some_array, :some_hash, :time
I am not sure that this way is simple. I usually use for gem configuration
this code
require 'active_support/configurable'
module GemModule
include ActiveSupport::Configurable
class self
def setup
yield config
end
end
end
And then you can write
GemModule.setup do |config|
On Sunday, September 23, 2012 8:11:43 AM UTC-4, Ilia Bylich wrote:
I am not sure that this way is simple. I usually use for gem configuration
this code
require 'active_support/configurable'
module GemModule
include ActiveSupport::Configurable
class self
def setup
yield
3 matches
Mail list logo