Class: LoadConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/nexmo_developer/app/services/load_config.rb

Class Method Summary collapse

Class Method Details

.docs_base_pathObject



2
3
4
# File 'lib/nexmo_developer/app/services/load_config.rb', line 2

def self.docs_base_path
  Rails.configuration.docs_base_path || '.'
end

.load_file(file_path) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/nexmo_developer/app/services/load_config.rb', line 6

def self.load_file(file_path)
  full_path = "#{docs_base_path}/#{file_path}"
  if File.exist?(full_path)
    YAML.load_file(full_path)
  else
    YAML.load_file("#{Rails.root}/#{file_path}")
  end
end