Class: Swift::Result

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/swift/result.rb

Overview

Result.

Wrapper for command result. It lazily instantiates a new Swift::Record instance for each result row.

Instance Method Summary collapse

Constructor Details

#initialize(record, result) ⇒ Result

Returns a new instance of Result.



13
14
15
16
# File 'lib/swift/result.rb', line 13

def initialize record, result
  @record = record
  @result = result
end

Instance Method Details

#eachObject



18
19
20
21
22
# File 'lib/swift/result.rb', line 18

def each
  @result.each do |tuple|
    yield @record.load(tuple)
  end
end