Module: DynamodbModel::Util

Included in:
DynamodbModel
Defined in:
lib/dynamodb_model/util.rb

Constant Summary collapse

@@app_root =

Ensures trailing slash Useful for appending a ‘./’ in front of a path or leaving it alone. Returns: ‘/path/with/trailing/slash/’ or ‘./’

nil

Instance Method Summary collapse

Instance Method Details

#app_rootObject



8
9
10
11
12
13
14
# File 'lib/dynamodb_model/util.rb', line 8

def app_root
  return @@app_root if @@app_root
  @@app_root = ENV['APP_ROOT'].to_s
  @@app_root = '.' if @@app_root == ''
  @@app_root = "#{@@app_root}/" unless @@app_root.ends_with?('/')
  @@app_root
end