Class: DataMapper::Paginator::ControlHelper::All
- Inherits:
-
Object
- Object
- DataMapper::Paginator::ControlHelper::All
- Defined in:
- lib/dm-paginator/control/all.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#paginator ⇒ Object
readonly
Returns the value of attribute paginator.
Instance Method Summary collapse
-
#initialize(paginator, options = {}) ⇒ All
constructor
A new instance of All.
- #pages(page_range = nil) ⇒ Object
Methods included from DataMapper::Paginator::ControlHelperAbstract
#normalize_page_number, #pages_in_range
Constructor Details
#initialize(paginator, options = {}) ⇒ All
Returns a new instance of All.
9 10 11 12 13 14 15 16 |
# File 'lib/dm-paginator/control/all.rb', line 9 def initialize paginator, = {} if !paginator.is_a?( Main ) raise ArgumentError, "paginator argument is not an instance of Main" end @paginator = paginator @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/dm-paginator/control/all.rb', line 7 def @options end |
#paginator ⇒ Object (readonly)
Returns the value of attribute paginator.
7 8 9 |
# File 'lib/dm-paginator/control/all.rb', line 7 def paginator @paginator end |
Instance Method Details
#pages(page_range = nil) ⇒ Object
18 19 20 21 |
# File 'lib/dm-paginator/control/all.rb', line 18 def pages page_range = nil return unless paginator.page_count > 0 return pages_in_range 1, paginator.count end |