Sha256: ca9baa17a1e3d75ceb79d009ba6c410536e004cdfd4c0af3d5cdeceeddd182ce

Contents?: true

Size: 526 Bytes

Versions: 6

Compression:

Stored size: 526 Bytes

Contents

# frozen_string_literal: true

require_relative './base_processor'
require_relative './paginate/enumerable_adapter'

class ActiveSet
  class PaginateProcessor < BaseProcessor
    def process
      adapter.new(@set, instruction).process
    end

    private

    def adapter
      EnumerableAdapter
    end

    def instruction
      Instructions::Entry.new(page_number, pagesize)
    end

    def page_number
      @instructions.get(:page) || 1
    end

    def pagesize
      @instructions.get(:size) || 25
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activeset-0.5.0 lib/active_set/processors/paginate_processor.rb
activeset-0.4.4 lib/active_set/processors/paginate_processor.rb
activeset-0.4.3 lib/active_set/processors/paginate_processor.rb
activeset-0.4.2 lib/active_set/processors/paginate_processor.rb
activeset-0.4.1 lib/active_set/processors/paginate_processor.rb
activeset-0.4.0 lib/active_set/processors/paginate_processor.rb