Module: SeedGimmick::SeedIO

Defined in:
lib/seed_gimmick/seed_io.rb,
lib/seed_gimmick/seed_io/base.rb,
lib/seed_gimmick/seed_io/yaml_file.rb

Defined Under Namespace

Classes: Base, YamlFile

Class Method Summary collapse

Class Method Details

.get(seed_file) ⇒ Object



6
7
8
9
10
11
# File 'lib/seed_gimmick/seed_io.rb', line 6

def self.get(seed_file)
  ext = File.extname(seed_file.to_s).presence || (raise SeedGimmickError)
  ext.sub!(/\A\./, "")
  ext = "yaml" if ext == "yml"
  const_get("#{ext.capitalize}File", false).new(seed_file)
end