Method: Glyph::Config#initialize
- Defined in:
- lib/glyph/config.rb
#initialize(options = {}) ⇒ Config
Initializes the configuration with a hash of options:
-
:file (default: nil) - A YAML file to read data from
-
:data (default: {})- The initial contents
-
:resettable (default: false) - Whether the configuration can be reset (cleared) or not
-
:mutable (default: true) - Whether the configuration can be changed or not
18 19 20 21 22 23 24 |
# File 'lib/glyph/config.rb', line 18 def initialize(={}) = {:file => nil, :data => {}, :resettable => false, :mutable => true} = .merge @file = [:file] @data = [:data] read if @file end |