Class: Photish::Config::FileConfig
- Inherits:
-
Object
- Object
- Photish::Config::FileConfig
- Defined in:
- lib/photish/config/file_config.rb
Constant Summary collapse
- FILE_NAME =
'config.yml'
Instance Method Summary collapse
- #hash ⇒ Object
-
#initialize(config_dir) ⇒ FileConfig
constructor
A new instance of FileConfig.
- #path ⇒ Object
Constructor Details
#initialize(config_dir) ⇒ FileConfig
Returns a new instance of FileConfig.
6 7 8 |
# File 'lib/photish/config/file_config.rb', line 6 def initialize(config_dir) @config_dir = config_dir end |
Instance Method Details
#hash ⇒ Object
10 11 12 13 |
# File 'lib/photish/config/file_config.rb', line 10 def hash return {} if !File.exist?(path) YAML.load_file(path) end |
#path ⇒ Object
15 16 17 |
# File 'lib/photish/config/file_config.rb', line 15 def path File.join(directory, config_file_name) end |