Created
July 22, 2016 14:02
-
-
Save felixtriller/01f6abb60f6ce7270d8be938bd37f98f to your computer and use it in GitHub Desktop.
Rails Module Configuration
This file contains 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
LibMattrTest.setup do |config| | |
config.super_setting1 = 'hi there' | |
config.super_setting2 = 23 | |
end |
This file contains 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
module LibMattrTest | |
extend ActiveSupport::Autoload | |
mattr_accessor :super_setting1 | |
@@super_setting1 = 'default' | |
mattr_accessor :super_setting2 | |
@@super_setting2 = nil | |
def self.setup | |
yield self | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use setting with
LibMattrTest.super_setting1