ResultadosDigitais/feature_flagger

View on GitHub
lib/feature_flagger/manifest_sources/with_yaml_file.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
module FeatureFlagger
  module ManifestSources
    class WithYamlFile
      def initialize(yaml_path = nil)
        @yaml_path = yaml_path
        @yaml_path ||= "#{Rails.root}/config/rollout.yml" if defined?(Rails)
      end

      def resolved_info
        @resolved_info ||= ::YAML.load_file(@yaml_path) if @yaml_path
      end
    end
  end
end