33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/arrow/table-loader.rb', line 33
def load
format = @options[:format]
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
deprecated_formats = ["batch", "stream"]
available_formats -= deprecated_formats
message = "Arrow::Table load format must be one of ["
message << available_formats.join(", ")
message << "]: #{format.inspect}"
raise ArgumentError, message
end
if method(custom_load_method).arity.zero?
__send__(custom_load_method)
else
__send__(custom_load_method, @input)
end
end
|