Class: SimplePaginate::Helpers::Paginator::PageProxy
- Inherits:
-
Object
- Object
- SimplePaginate::Helpers::Paginator::PageProxy
- Defined in:
- lib/simple_paginate/helpers/paginator.rb
Instance Method Summary collapse
- #+(other) ⇒ Object
- #-(other) ⇒ Object
- #<=>(other) ⇒ Object
- #first? ⇒ Boolean
-
#initialize(options) ⇒ PageProxy
constructor
A new instance of PageProxy.
- #last? ⇒ Boolean
- #number ⇒ Object
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(options) ⇒ PageProxy
Returns a new instance of PageProxy.
32 33 34 |
# File 'lib/simple_paginate/helpers/paginator.rb', line 32 def initialize() @options = end |
Instance Method Details
#+(other) ⇒ Object
56 57 58 |
# File 'lib/simple_paginate/helpers/paginator.rb', line 56 def +(other) to_i + other.to_i end |
#-(other) ⇒ Object
60 61 62 |
# File 'lib/simple_paginate/helpers/paginator.rb', line 60 def -(other) to_i - other.to_i end |
#<=>(other) ⇒ Object
64 65 66 |
# File 'lib/simple_paginate/helpers/paginator.rb', line 64 def <=>(other) to_i <=> other.to_i end |
#first? ⇒ Boolean
40 41 42 |
# File 'lib/simple_paginate/helpers/paginator.rb', line 40 def first? @options[:current_page] == 1 end |
#last? ⇒ Boolean
44 45 46 |
# File 'lib/simple_paginate/helpers/paginator.rb', line 44 def last? @options[:length] < @options[:per_page] end |
#number ⇒ Object
36 37 38 |
# File 'lib/simple_paginate/helpers/paginator.rb', line 36 def number @options[:current_page] end |
#to_i ⇒ Object
48 49 50 |
# File 'lib/simple_paginate/helpers/paginator.rb', line 48 def to_i number end |
#to_s ⇒ Object
52 53 54 |
# File 'lib/simple_paginate/helpers/paginator.rb', line 52 def to_s number.to_s end |