Class: Pedia::Config
- Inherits:
-
Object
- Object
- Pedia::Config
- Defined in:
- lib/wp/config.rb
Defined Under Namespace
Classes: Option
Constant Summary collapse
- CONFIG_DIR =
Constants #########################################################
File. "~/.config/pedia"
- CACHE_DIR =
File. "~/.cache/pedia"
- CONFIG_FILE =
File.join CONFIG_DIR, "config.yml"
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(filename = "config.yml") ⇒ Config
constructor
Methods ###########################################################.
- #options ⇒ Object
Constructor Details
#initialize(filename = "config.yml") ⇒ Config
Methods ###########################################################
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/wp/config.rb', line 54 def initialize(filename="config.yml") Dir.mkdir CONFIG_DIR unless File.exists? CONFIG_DIR unless File.exists? CONFIG_FILE end yaml = YAML.load open(CONFIG_FILE) @options = {} yaml.each do |key, val| p [key, val] if opt = @@spec[key] @options[key] = opt.with(value: val) end end end |
Class Method Details
Instance Method Details
#options ⇒ Object
74 75 76 |
# File 'lib/wp/config.rb', line 74 def @options end |