Class: Photish::Config::FileConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/photish/config/file_config.rb

Constant Summary collapse

FILE_NAME =
'config.yml'

Instance Method Summary collapse

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

#hashObject



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

#pathObject



15
16
17
# File 'lib/photish/config/file_config.rb', line 15

def path
  File.join(directory, config_file_name)
end