Class: WoopleTheme::Dashboard::EssentialsSectionPresenter

Inherits:
SectionPresenter show all
Defined in:
app/presenters/woople_theme/dashboard/essentials_section_presenter.rb

Instance Method Summary collapse

Methods inherited from SectionPresenter

#css_id, #render, #title

Methods inherited from ExplicitDelegator

enforce_definitions, #enforced_methods, #ensure_defined, #initialize

Constructor Details

This class inherits a constructor from ExplicitDelegator

Instance Method Details

#render_completedObject



12
13
14
# File 'app/presenters/woople_theme/dashboard/essentials_section_presenter.rb', line 12

def render_completed
  yield if render?(section.essentials_completed)
end

#render_remainingObject



8
9
10
# File 'app/presenters/woople_theme/dashboard/essentials_section_presenter.rb', line 8

def render_remaining
  yield if render?(section.essentials_remaining)
end

#total_completed_coursesObject



16
17
18
# File 'app/presenters/woople_theme/dashboard/essentials_section_presenter.rb', line 16

def total_completed_courses
  section.essentials_completed.count
end

#total_completed_minutesObject



20
21
22
# File 'app/presenters/woople_theme/dashboard/essentials_section_presenter.rb', line 20

def total_completed_minutes
  Duration.format_time(section.essentials_completed.map(&:time_total).inject(0, :+))
end