Class: RackFlags::Config
- Inherits:
-
Object
- Object
- RackFlags::Config
- Defined in:
- lib/rack-flags/config.rb
Instance Attribute Summary collapse
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(flag_config) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(flag_config) ⇒ Config
Returns a new instance of Config.
13 14 15 16 17 18 19 |
# File 'lib/rack-flags/config.rb', line 13 def initialize(flag_config) flag_config ||= {} @flags = flag_config.map do |flag_name, flag_details| base_flag_from_config_entry(flag_name,flag_details) end end |
Instance Attribute Details
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
6 7 8 |
# File 'lib/rack-flags/config.rb', line 6 def flags @flags end |
Class Method Details
.load(yaml_path) ⇒ Object
8 9 10 11 |
# File 'lib/rack-flags/config.rb', line 8 def self.load( yaml_path ) flags = YAML.load( File.read( yaml_path ) ) new( flags ) end |