Skip to content

Commit

Permalink
Merge pull request #2 from sellektor/ruby3
Browse files Browse the repository at this point in the history
Ruby 3 compatibility
  • Loading branch information
szajbus authored Jun 9, 2021
2 parents ea669d8 + eca4c9d commit eda2a0d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ rvm:
- 2.5
- 2.6
- 2.7
- 3.0
before_install:
- curl https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.2-amd64.deb -o elasticsearch.deb
- sudo dpkg -i --force-confnew elasticsearch.deb
Expand Down
17 changes: 12 additions & 5 deletions lib/elastic/scroll.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ module Elastic
class Scroll
include Enumerable

def initialize(client, index_name, size: 1_000, scroll: '5m', body: {}, stored_fields: [])
def initialize(client, index_name, options = {})
options = {
size: 1_000,
scroll: '5m',
body: {},
stored_fields: []
}.merge(options)

@client = client
@index_name = index_name
@size = size
@scroll = scroll
@body = body
@stored_fields = stored_fields
@size = options[:size]
@scroll = options[:scroll]
@body = options[:body]
@stored_fields = options[:stored_fields]
end

def each
Expand Down

0 comments on commit eda2a0d

Please sign in to comment.