Module: Uchi::Pagy::Rangeable
- Included in:
- Offset
- Defined in:
- lib/uchi/pagy/modules/abilities/rangeable.rb
Overview
Add method supporting range checking, range error and rescue
Instance Method Summary collapse
-
#in_range? ⇒ Boolean
Check if in range.
Instance Method Details
#in_range? ⇒ Boolean
Check if in range
8 9 10 11 12 13 14 |
# File 'lib/uchi/pagy/modules/abilities/rangeable.rb', line 8 def in_range? return @in_range if defined?(@in_range) || (@in_range = yield) raise RangeError.new(self, :page, "in 1..#{@last}", @page) if [:raise_range_error] assign_empty_page_variables false end |