class Grayskull::DataFile

The DataFile class contains methods for loading and working with the supported data files.

Public Class Methods

load(file) click to toggle source

Loads the specified file depending on the format

# File lib/grayskull/datafile.rb, line 8
def self.load(file)
 
  format = Formats::detect_format File.basename(file)
 
  case format
    when 'yaml'
      return Formats::YAMLHandler.load(file)
    when 'json'
      return Formats::JSONHandler.load(file)
   end
   
end