Module: Keycloak::Admin::Resource::Pagination
Overview
Abstract class extension for Keycloak::Admin resources with methods providing pagination.
-
#all
Constant Summary collapse
- MAX_ENTRIES =
100
Instance Method Summary collapse
-
#all ⇒ Object
List all resources.
Instance Method Details
#all ⇒ Object
List all resources.
16 17 18 19 20 21 22 23 24 |
# File 'lib/keycloak/admin/resource/pagination.rb', line 16 def all objects = [] (1..pages).each do |page| first = (page * MAX_ENTRIES) - MAX_ENTRIES objects << @agent.get("#{resource}?first=#{first}&max=#{MAX_ENTRIES}") end objects.flatten.map { |object| mash(object) } end |