Class: WoopleTheme::Dashboard::EssentialsSectionPresenter
Instance Method Summary
collapse
#css_id, #render, #title
enforce_definitions, #enforced_methods, #ensure_defined, #initialize
Instance Method Details
#render_completed ⇒ Object
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_remaining ⇒ Object
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_courses ⇒ Object
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_minutes ⇒ Object
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
|