Class: RushJobMongoid::QueueGroupsPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/rush_job_mongoid/queue_groups_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(queue_groups_page) ⇒ QueueGroupsPresenter

Returns a new instance of QueueGroupsPresenter.



5
6
7
8
9
# File 'app/presenters/rush_job_mongoid/queue_groups_presenter.rb', line 5

def initialize(queue_groups_page)
  @queue_groups_presenter = PaginationPresenter.new(queue_groups_page)
  @rush_job_queue_groups = RushJob.queue_groups
  @queue_groups = queue_groups_from_presener
end

Instance Attribute Details

#queue_groupsObject (readonly)

Returns the value of attribute queue_groups.



3
4
5
# File 'app/presenters/rush_job_mongoid/queue_groups_presenter.rb', line 3

def queue_groups
  @queue_groups
end

#queue_groups_presenterObject (readonly)

Returns the value of attribute queue_groups_presenter.



3
4
5
# File 'app/presenters/rush_job_mongoid/queue_groups_presenter.rb', line 3

def queue_groups_presenter
  @queue_groups_presenter
end

#rush_job_queue_groupsObject (readonly)

Returns the value of attribute rush_job_queue_groups.



3
4
5
# File 'app/presenters/rush_job_mongoid/queue_groups_presenter.rb', line 3

def rush_job_queue_groups
  @rush_job_queue_groups
end

Instance Method Details

#pageObject



15
16
17
# File 'app/presenters/rush_job_mongoid/queue_groups_presenter.rb', line 15

def page
  @queue_groups_presenter.page
end

#pages_countObject



11
12
13
# File 'app/presenters/rush_job_mongoid/queue_groups_presenter.rb', line 11

def pages_count
  @queue_groups_presenter.pages(@rush_job_queue_groups.count, 10)
end