Class: Low::FileQuery

Inherits:
Object show all
Defined in:
lib/queries/file_query.rb

Class Method Summary collapse

Class Method Details

.file_path(klass:) ⇒ Object

Raises:



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

def file_path(klass:)
  file_path = Object.const_source_location(klass.name).first

  return file_path if File.exist?(file_path)

  raise MissingFileError, "No file found at path '#{file_path}'"
end