class Metacrunch::DB::Source
Constants
- DEFAULT_OPTIONS
Public Class Methods
new(sequel_dataset, options = {})
click to toggle source
# File lib/metacrunch/db/source.rb, line 12 def initialize(sequel_dataset, options = {}) @dataset = sequel_dataset @options = DEFAULT_OPTIONS.merge(options) unless @dataset.opts[:order] raise ArgumentError, "The dataset must be ordered." end end
Public Instance Methods
each() { |row| ... }
click to toggle source
# File lib/metacrunch/db/source.rb, line 21 def each(&block) return enum_for(__method__) unless block_given? @dataset.paged_each( rows_per_fetch: @options[:rows_per_fetch], strategy: @options[:strategy], filter_values: @options[:filter_values] ) do |row| yield(row) end self end