Class: Intersys::Query
- Inherits:
-
Object
- Object
- Intersys::Query
- Defined in:
- lib/intersys.rb
Overview
Class representing one query You shouldn’t create it yourself
Instance Attribute Summary collapse
-
#database ⇒ Object
readonly
Returns the value of attribute database.
Instance Method Summary collapse
- #each ⇒ Object
- #fill(data) ⇒ Object
-
#initialize(database, query) ⇒ Query
constructor
A new instance of Query.
- #to_a ⇒ Object
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
#database ⇒ Object (readonly)
Returns the value of attribute database.
277 278 279 |
# File 'lib/intersys.rb', line 277 def database @database end |
Instance Method Details
#each ⇒ Object
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_a ⇒ Object
291 292 293 294 295 |
# File 'lib/intersys.rb', line 291 def to_a data = [] self.each {|row| data << row} data end |