module Lhj # config class Config def home_dir @home_dir ||= Pathname.new('~/.lhj').expand_path end def self.instance @instance ||= new end class << self attr_writer :instance end # Provides support for accessing the configuration instance in other # scopes. # module Mixin def config Config.instance end end end end