Class: OutlinePresenter

Inherits:
SimpleDelegator
  • Object
show all
Includes:
ActionView::Helpers::TagHelper
Defined in:
app/presenters/outline_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#view_contextObject

Returns the value of attribute view_context.



7
8
9
# File 'app/presenters/outline_presenter.rb', line 7

def view_context
  @view_context
end

Instance Method Details

#assessmentObject



23
24
25
26
# File 'app/presenters/outline_presenter.rb', line 23

def assessment
  wrapped_assessment = ThemePresentation.wrap(outline.assessment, OutlineAssessmentPresenter)
  view_context.render partial: 'woople-theme/outline_assessment', locals: { assessment: wrapped_assessment }
end

#downloads(downloads = outline.downloads) ⇒ Object



18
19
20
21
# File 'app/presenters/outline_presenter.rb', line 18

def downloads(downloads = outline.downloads)
  wrapped_downloads = ThemePresentation.wrap_collection(downloads, OutlineDownloadPresenter)
  view_context.render partial: 'woople-theme/outline_downloads', locals: { downloads: wrapped_downloads }
end

#nameObject



9
10
11
# File 'app/presenters/outline_presenter.rb', line 9

def name
  (:h2, outline.name)
end

#videos(videos = outline.videos) ⇒ Object



13
14
15
16
# File 'app/presenters/outline_presenter.rb', line 13

def videos(videos = outline.videos)
  wrapped_videos = ThemePresentation.wrap_collection(videos, OutlineVideoPresenter)
  view_context.render partial: 'woople-theme/outline_videos', locals: { videos: wrapped_videos }
end