Sha256: 1d43800f8ff5fc105cbd235d9ad530763081063d9a2d17ac832de5a3778ee443

Contents?: true

Size: 345 Bytes

Versions: 7

Compression:

Stored size: 345 Bytes

Contents

# frozen_string_literal: true

module ActionTracker
  module Pagination
    delegate :next_cursor, :current_cursor, to: :meta

    def size
      raw_data.try(:size)
    end

    def per_page
      meta.per_page.to_i
    end

    def last_page?
      next_cursor.blank?
    end

    def first_page?
      current_cursor.blank?
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
action_tracker_client-0.1.8 lib/action_tracker/utils/pagination.rb
action_tracker_client-0.1.7 lib/action_tracker/utils/pagination.rb
action_tracker_client-0.1.6 lib/action_tracker/utils/pagination.rb
action_tracker_client-0.1.5 lib/action_tracker/utils/pagination.rb
action_tracker_client-0.1.4 lib/action_tracker/utils/pagination.rb
action_tracker_client-0.1.3 lib/action_tracker/utils/pagination.rb
action_tracker_client-0.1.2 lib/action_tracker/utils/pagination.rb