Class: DbAgile::IO::Ruby::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/dbagile/io/ruby.rb

Instance Method Summary collapse

Constructor Details

#initialize(io, options) ⇒ Reader

Returns a new instance of Reader.



7
8
9
10
# File 'lib/dbagile/io/ruby.rb', line 7

def initialize(io, options)
  @io = io
  @options = options
end

Instance Method Details

#read(file) ⇒ Object

Reads content of a file



13
14
15
16
17
18
# File 'lib/dbagile/io/ruby.rb', line 13

def read(file)
  if @options[:input_file]
    file = File.join(File.dirname(@options[:input_file]), file)
  end
  File.read(file)
end

#tuplesObject



20
21
22
# File 'lib/dbagile/io/ruby.rb', line 20

def tuples
  self.instance_eval(@io.read)
end