Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

47 lines (36 sloc) 0.748 kb
require 'singleton'
module Gmaps4rails
def self.config
Config.instance
end
class Config
include Singleton
def options
yaml_loader.load
end
protected
def yaml_loader
@yaml_loader ||= YamlLoader.new
end
class YamlLoader
attr_writer :config_file, :config_path
def load
@load ||= HashWithIndifferentAccess.new load_yaml
end
def config_path
Rails.root.join 'config', config_file
end
def config_file
@config_file ||= 'gmaps4rails.yml'
end
protected
def load_yaml
@yaml ||= begin
YAML.load File.read(config_path)
rescue
{}
end
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.