Skip to content

chrisftw/fast_config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#FastConfig

##Installation

  • Add to Gemfile

      gem "fast_config"
    
  • Install the gem

      bundle install
    

##How To Use

  • Extend your class with the module, and use settings however you like.

      require 'fast_config'
      
      class MyClassName
        extend FastConfig
    
        def self.setting_plus_1(setting_name)
          return settings[setting_name] + 1 # use settings however
        end
    
        def my_email
          "#{username}@#{MyClassName.settings[:email_domain]}"
        end
    
      end
    
  • Create config file in config/my_class_name.yml

      my_class_name:
        alpha: 12
        beta: "Hello World"
        gamma: "http://127.0.0.1:11211"
        email_domain: "gmail.com"
    

Contributors

Thank you to hoprocker for update needed for Ruby 3.1

About

Ruby gem to add simple configuration from a yaml file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages