Class: Csv2hash::Adapter::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/csv2hash/adapters/base.rb

Defined Under Namespace

Classes: UnsupportedAdapter

Class Method Summary (collapse)

Class Method Details

+ (Object) create(adapter_name, file_path_or_data)



7
8
9
10
# File 'lib/csv2hash/adapters/base.rb', line 7

def self.create adapter_name, file_path_or_data
  load "csv2hash/adapters/#{adapter_name}_adapter.rb"
  class_eval("Csv2hash::Adapter::#{klass_adapter(adapter_name)}").new file_path_or_data
end