Sha256: 9bfd906cb7ed8f947681058b68821cbc4bc12cf8eb49f27b51b0b3c741314766
Contents?: true
Size: 798 Bytes
Versions: 20
Compression:
Stored size: 798 Bytes
Contents
# frozen_string_literal: true module Karafka module Web module Ui module Controllers # Namespace for request related components module Requests # Internal representation of params with sane sanitization class Params # @param request_params [Hash] raw hash with params def initialize(request_params) @request_params = request_params end # @return [Integer] current page for paginated views # @note It does basic sanitization def current_page @current_page ||= begin page = @request_params['page'].to_i page.positive? ? page : 1 end end end end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems