31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/arrow/table-loader.rb', line 31
def load
path = @path
path = path.to_path if path.respond_to?(:to_path)
format = @options[:format] || guess_format(path) || :arrow
custom_load_method = "load_as_#{format}"
unless respond_to?(custom_load_method, true)
available_formats = []
(methods(true) | private_methods(true)).each do |name|
match_data = /\Aload_as_/.match(name.to_s)
if match_data
available_formats << match_data.post_match
end
end
message = "Arrow::Table load format must be one of ["
message << available_formats.join(", ")
message << "]: #{format.inspect}"
raise ArgumentError, message
end
__send__(custom_load_method, path)
end
|