debian-mirror-gitlab/lib/bulk_imports/pipeline/extracted_data.rb
2021-04-29 21:17:54 +05:30

29 lines
533 B
Ruby

# frozen_string_literal: true
module BulkImports
module Pipeline
class ExtractedData
attr_reader :data
def initialize(data: nil, page_info: {})
@data = Array.wrap(data)
@page_info = page_info
end
def has_next_page?
Gitlab::Utils.to_boolean(
@page_info&.dig('has_next_page'),
default: false
)
end
def next_page
@page_info&.dig('next_page')
end
def each(&block)
data.each(&block)
end
end
end
end