The way to store config options in ruby without using ENV variables

# my_project/config.rb
module MyProject
  class Config
    attr_accessor :my_cool_option, :my_other_option
  end
end

# my_project.rb
module MyProject
  def self.config
    @config ||= Config.new
  end

  def self.configure
    yield(config)
  end

Поделиться с друзьями

Френдинг

 

Comments

No comments so far.

Leave a Reply

 
(will not be published)
 
 
Comment