Sha256: 788beb2eeea224dd9a72c0714dc47e722e1b481284e0fff3d2c1cd86dd4b84b8
Contents?: true
Size: 614 Bytes
Versions: 28
Compression:
Stored size: 614 Bytes
Contents
module Ddr module Contacts extend ActiveSupport::Autoload class << self attr_accessor :contacts end def self.get(contact_slug) load_contacts unless contacts contacts[contact_slug] end def self.load_contacts self.contacts = OpenStruct.new contacts_file = File.join(Rails.root, 'config', 'contacts.yml') YAML.load_file(contacts_file).each do |key, value| contacts[key] = OpenStruct.new(value.merge('slug' => key)) end rescue SystemCallError Rails.logger.warn("Unable to load Contacts file: #{contacts_file}") end end end
Version data entries
28 entries across 28 versions & 1 rubygems