Class: Trufina::Config

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

Overview

Reads in configuration data from config/trufina.yml (and handles creating it if missing / complaining if it looks unfilled).

Constant Summary collapse

@@mode =
env && env == 'production' ? 'production' : 'staging'

Class Method Summary collapse

Class Method Details

.debug?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/config.rb', line 58

def debug?
  !!@@debug
end

.symbolize_keys!(hash) ⇒ Object

Symbolize hash keys - defined here so we don’t rely on Rails



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/config.rb', line 17

def self.symbolize_keys!(hash) # :nodoc:
  return hash unless hash.is_a?(Hash)
  
  hash.keys.each do |key|
    unless key.is_a?(Symbol)
      hash[key.to_sym] = hash[key]
      hash.delete(key)
    end
  end
  hash
end