This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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| | |
config.option1 = "value1" | |
config.option2 = 2 | |
end | |
And | |
GemModule.config.option1 |
No comments:
Post a Comment