Sha256: d516281a7cccfcc51c3ef856c559c5bc749338b102f7a6fe315345a0b0cc2cab

Contents?: true

Size: 438 Bytes

Versions: 18

Compression:

Stored size: 438 Bytes

Contents

module Groonga
  class TableCursor
    class << self
      def open(*arguments)
        cursor = open_raw(*arguments)
        if block_given?
          begin
            yield(cursor)
          ensure
            cursor.close
          end
        else
          cursor
        end
      end
    end

    def each
      loop do
        id = self.next
        return if id == Groonga::ID::NIL
        yield(id)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rroonga-5.1.1-x86-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.1.1-x64-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.9-x86-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.9-x64-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.8-x86-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.8-x64-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.5-x86-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.5-x64-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.4-x86-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.4-x64-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.3-x86-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.3-x64-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.2-x64-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.2-x86-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.1-x86-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.1-x64-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.0-x64-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb
rroonga-5.0.0-x86-mingw32 vendor/local/lib/groonga/scripts/ruby/table_cursor.rb