Module: EnvironmentHelpers::FileHelpers

Included in:
EnvironmentHelpers
Defined in:
lib/environment_helpers/file_helpers.rb

Instance Method Summary collapse

Instance Method Details

#file_path(name, default: nil, required: false) ⇒ Object



5
6
7
8
9
10
# File 'lib/environment_helpers/file_helpers.rb', line 5

def file_path(name, default: nil, required: false)
  check_default_type(:file_path, default, String)
  path = fetch_value(name, required: required) || default
  return nil if path.nil?
  Pathname.new(path)
end