Class: Footrest::Pagination::Links

Inherits:
Struct
  • Object
show all
Defined in:
lib/footrest/pagination.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#currentObject

Returns the value of attribute current

Returns:

  • (Object)

    the current value of current


5
6
7
# File 'lib/footrest/pagination.rb', line 5

def current
  @current
end

#firstObject

Returns the value of attribute first

Returns:

  • (Object)

    the current value of first


5
6
7
# File 'lib/footrest/pagination.rb', line 5

def first
  @first
end

#lastObject

Returns the value of attribute last

Returns:

  • (Object)

    the current value of last


5
6
7
# File 'lib/footrest/pagination.rb', line 5

def last
  @last
end

#nextObject

Returns the value of attribute next

Returns:

  • (Object)

    the current value of next


5
6
7
# File 'lib/footrest/pagination.rb', line 5

def next
  @next
end

#prevObject Also known as: previous

Returns the value of attribute prev

Returns:

  • (Object)

    the current value of prev


5
6
7
# File 'lib/footrest/pagination.rb', line 5

def prev
  @prev
end

Instance Method Details

#last_page?Boolean

Returns:

  • (Boolean)

9
10
11
12
# File 'lib/footrest/pagination.rb', line 9

def last_page?
  return false unless self.current && self.last
  self.current == self.last
end