Class: Arrow::TableLoader
- Inherits:
-
Object
- Object
- Arrow::TableLoader
- Defined in:
- lib/arrow/table-loader.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path, options = {}) ⇒ TableLoader
constructor
A new instance of TableLoader.
- #load ⇒ Object
Constructor Details
#initialize(path, options = {}) ⇒ TableLoader
Returns a new instance of TableLoader.
26 27 28 29 |
# File 'lib/arrow/table-loader.rb', line 26 def initialize(path, ={}) @path = path = end |
Class Method Details
.load(path, options = {}) ⇒ Object
21 22 23 |
# File 'lib/arrow/table-loader.rb', line 21 def load(path, ={}) new(path, ).load end |
Instance Method Details
#load ⇒ Object
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 = [: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 = "Arrow::Table load format must be one of [" << available_formats.join(", ") << "]: #{format.inspect}" raise ArgumentError, end __send__(custom_load_method, path) end |