Class: ActsAsCalculator::ReadImportFile

Inherits:
Object
  • Object
show all
Defined in:
lib/acts_as_calculator/read_import_file.rb

Class Method Summary collapse

Class Method Details

.call(path) ⇒ Object

Raises:



7
8
9
10
11
# File 'lib/acts_as_calculator/read_import_file.rb', line 7

def self.call(path)
  raise ImportError, "no import file at #{path}" unless File.file?(path.to_s)

  parse(File.read(path.to_s), path)
end