Module: Screenplay::Configuration
- Extended by:
- Configuration
- Includes:
- Enumerable
- Included in:
- Configuration
- Defined in:
- lib/screenplay/configuration.rb
Instance Method Summary collapse
Instance Method Details
#[](key) ⇒ Object
17 18 19 |
# File 'lib/screenplay/configuration.rb', line 17 def [](key) @config[key] end |
#each ⇒ Object
13 14 15 |
# File 'lib/screenplay/configuration.rb', line 13 def each @config.each { | k, v | yield k, v } end |
#load(reload = false) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/screenplay/configuration.rb', line 21 def load(reload = false) return unless @config.empty? || reload @filename = $SCREENPLAY_CONFIGFILE || './config.yaml' || './config.yml' @config = YAML.load_file(@filename) if File.exists?(@filename) @config.symbolize_keys! end |
#path ⇒ Object
28 29 30 |
# File 'lib/screenplay/configuration.rb', line 28 def path File.dirname(@filename) || './' end |
#to_h ⇒ Object
32 33 34 |
# File 'lib/screenplay/configuration.rb', line 32 def to_h @config.to_h end |