Class: Shaf::Settings

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

Constant Summary collapse

SETTINGS_FILE =
'config/settings.yml'
DEFAULTS =
{
  public_folder: 'frontend/assets',
  views_folder: 'frontend/views',
  documents_dir: 'doc/api',
  migrations_dir: 'db/migrations',
  fixtures_dir: 'spec/fixtures',
  paginate_per_page: 25
}.freeze

Class Method Summary collapse

Class Method Details

.envObject



19
20
21
# File 'lib/shaf/settings.rb', line 19

def env
  (ENV['APP_ENV'] || ENV['RACK_ENV'] || 'development').to_sym
end

.key?(key) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/shaf/settings.rb', line 23

def key?(key)
  settings.key? key
end

.loaded?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/shaf/settings.rb', line 31

def loaded?
  !!defined? @settings
end

.to_hObject



27
28
29
# File 'lib/shaf/settings.rb', line 27

def to_h
  settings.dup
end