Class: Baza::ResultBase

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/baza/result_base.rb

Instance Method Summary collapse

Instance Method Details

#to_aObject



17
18
19
20
21
22
23
24
# File 'lib/baza/result_base.rb', line 17

def to_a
  array = []
  each do |row_data|
    array << row_data
  end

  array
end

#to_a_enumObject



12
13
14
15
# File 'lib/baza/result_base.rb', line 12

def to_a_enum
  require "array_enumerator"
  @a_enum ||= ArrayEnumerator.new(to_enum)
end

#to_enumObject



4
5
6
7
8
9
10
# File 'lib/baza/result_base.rb', line 4

def to_enum
  @enum ||= Enumerator.new do |y|
    each do |data|
      y << data
    end
  end
end