Sha256: 2ef5dc106d70744780b972d9269bb2276d2348921e35d61f086aac51cf5cae14

Contents?: true

Size: 666 Bytes

Versions: 80

Compression:

Stored size: 666 Bytes

Contents

require 'active_support'

class LHS::Record

  module Pagination
    extend ActiveSupport::Concern
    # Kaminari-Interface
    delegate :current_page, :first_page, :last_page, :prev_page, :next_page, :limit_value, :total_pages, to: :_pagination

    def _pagination
      self.class.pagination(_data)
    end

    module ClassMethods
      def pagination_class
        case pagination_strategy.to_sym
        when :page
          LHS::Pagination::Page
        when :start
          LHS::Pagination::Start
        else
          LHS::Pagination::Offset
        end
      end

      def pagination(data)
        pagination_class.new(data)
      end
    end
  end
end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
lhs-15.4.1 lib/lhs/concerns/record/pagination.rb
lhs-15.4.0 lib/lhs/concerns/record/pagination.rb
lhs-15.4.0.pre.hasone.1 lib/lhs/concerns/record/pagination.rb
lhs-15.3.3 lib/lhs/concerns/record/pagination.rb
lhs-15.3.3.pre.fixoptions.1 lib/lhs/concerns/record/pagination.rb
lhs-15.3.2 lib/lhs/concerns/record/pagination.rb
lhs-15.3.1 lib/lhs/concerns/record/pagination.rb
lhs-15.3.1.pre.fixlhc.1 lib/lhs/concerns/record/pagination.rb
lhs-15.3.0 lib/lhs/concerns/record/pagination.rb
lhs-15.2.5 lib/lhs/concerns/record/pagination.rb
lhs-15.2.4 lib/lhs/concerns/record/pagination.rb
lhs-15.2.3 lib/lhs/concerns/record/pagination.rb
lhs-15.2.3.pre.favorites.1 lib/lhs/concerns/record/pagination.rb
lhs-15.2.2.pre.favorites.1 lib/lhs/concerns/record/pagination.rb
lhs-15.2.2 lib/lhs/concerns/record/pagination.rb
lhs-15.2.1 lib/lhs/concerns/record/pagination.rb
lhs-15.2.0 lib/lhs/concerns/record/pagination.rb
lhs-15.1.1 lib/lhs/concerns/record/pagination.rb
lhs-15.1.0 lib/lhs/concerns/record/pagination.rb
lhs-15.0.2 lib/lhs/concerns/record/pagination.rb