Class: FeatureToggles::Loader
- Inherits:
-
Object
- Object
- FeatureToggles::Loader
- Defined in:
- lib/feature_toggles/loader.rb
Instance Method Summary collapse
-
#initialize(env) ⇒ Loader
constructor
A new instance of Loader.
- #load(file_name) ⇒ Object
Constructor Details
#initialize(env) ⇒ Loader
Returns a new instance of Loader.
3 4 5 |
# File 'lib/feature_toggles/loader.rb', line 3 def initialize(env) @env = env end |
Instance Method Details
#load(file_name) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/feature_toggles/loader.rb', line 7 def load(file_name) @feature_toggle_data ||= begin file_path = Rails.root.join("config", file_name) toggle_settings = HashWithIndifferentAccess.new(YAML::load(File.open(file_path))) toggle_settings[@env] end end |