Class: Fidelity::PaginationHelper::Pagination::Item

Inherits:
Object
  • Object
show all
Defined in:
app/fidelity/widgets/pagination/helpers/pagination_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page = 1, current = 1) ⇒ Item

Returns a new instance of Item.



50
51
52
53
# File 'app/fidelity/widgets/pagination/helpers/pagination_helper.rb', line 50

def initialize page=1, current=1
  @page = page
  @current = current==page
end

Instance Attribute Details

#currentObject

Returns the value of attribute current.



49
50
51
# File 'app/fidelity/widgets/pagination/helpers/pagination_helper.rb', line 49

def current
  @current
end

#pageObject

Returns the value of attribute page.



49
50
51
# File 'app/fidelity/widgets/pagination/helpers/pagination_helper.rb', line 49

def page
  @page
end

Instance Method Details

#current?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'app/fidelity/widgets/pagination/helpers/pagination_helper.rb', line 59

def current?
  @current
end

#show?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'app/fidelity/widgets/pagination/helpers/pagination_helper.rb', line 55

def show?
  !@page.nil?
end