class Photish::Config::FileConfig

Constants

FILE_NAME

Attributes

config_dir[R]

Public Class Methods

new(config_dir) click to toggle source
# File lib/photish/config/file_config.rb, line 6
def initialize(config_dir)
  @config_dir = config_dir
end

Public Instance Methods

hash() click to toggle source
# File lib/photish/config/file_config.rb, line 10
def hash
  return {} if !File.exist?(path)
  YAML.load_file(path)
end
path() click to toggle source
# File lib/photish/config/file_config.rb, line 15
def path
  File.join(directory, config_file_name)
end

Private Instance Methods

config_file_name() click to toggle source
# File lib/photish/config/file_config.rb, line 27
def config_file_name
  FILE_NAME
end
directory() click to toggle source
# File lib/photish/config/file_config.rb, line 23
def directory
  config_dir || Dir.pwd
end