lib/bmg/reader/excel.rb in bmg-0.5.0 vs lib/bmg/reader/excel.rb in bmg-0.6.0

- old
+ new

@@ -5,11 +5,12 @@ DEFAULT_OPTIONS = { skip: 0 } - def initialize(path, options = {}) + def initialize(type, path, options = {}) + @type = type @path = path @options = DEFAULT_OPTIONS.merge(options) end def each @@ -27,9 +28,18 @@ tuple = (0...headers.size).each_with_object({}){|i,t| t[headers[i]] = row[i] } yield(tuple) end end end + + def to_ast + [ :excel, @path, @options ] + end + + def to_s + "(excel #{path})" + end + alias :inspect :to_s end # class Excel end # module Reader end # module Bmg \ No newline at end of file