Class: Intersys::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/intersys.rb

Overview

Class representing one query You shouldn’t create it yourself

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(database, query) ⇒ Query

Returns a new instance of Query.



279
280
281
282
# File 'lib/intersys.rb', line 279

def initialize(database, query)
  @database = database
  native_initialize(database, query.to_wchar)
end

Instance Attribute Details

#databaseObject (readonly)

Returns the value of attribute database.



277
278
279
# File 'lib/intersys.rb', line 277

def database
  @database
end

Instance Method Details

#eachObject



284
285
286
287
288
289
# File 'lib/intersys.rb', line 284

def each
  while (row = self.fetch) && row.size > 0
    #puts "Loaded row #{row}"
    yield row
  end
end

#fill(data) ⇒ Object



297
298
299
300
# File 'lib/intersys.rb', line 297

def fill(data)
  self.each {|row| data << row}
  self
end

#to_aObject



291
292
293
294
295
# File 'lib/intersys.rb', line 291

def to_a
  data = []
  self.each {|row| data << row}
  data
end