Class: RackFlags::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/rack-flags/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#flagsObject (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