Class: ContentItemPresenter

Inherits:
ExplicitDelegator show all
Includes:
ContentImage
Defined in:
app/presenters/content_item_presenter.rb

Constant Summary

Constants included from ContentImage

ContentImage::DEFAULT_IMAGE, ContentImage::MISSING_WOOPLE_IMAGE

Instance Method Summary collapse

Methods included from ContentImage

#image

Methods inherited from ExplicitDelegator

enforce_definitions, #enforced_methods, #ensure_defined, #initialize

Constructor Details

This class inherits a constructor from ExplicitDelegator

Instance Method Details

#completed_classObject



35
36
37
# File 'app/presenters/content_item_presenter.rb', line 35

def completed_class
  'completed' if source.completed?
end

#render_certification_metadata {|source.certification_metadata| ... } ⇒ Object

Yields:

  • (source.certification_metadata)


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

def (&block)
  yield(source.) if source..present?
end

#render_completed_on(&block) ⇒ Object



26
27
# File 'app/presenters/content_item_presenter.rb', line 26

def render_completed_on(&block)
end

#render_elective_points(&block) ⇒ Object



29
30
# File 'app/presenters/content_item_presenter.rb', line 29

def render_elective_points(&block)
end

#render_essential_duration(&block) ⇒ Object



32
33
# File 'app/presenters/content_item_presenter.rb', line 32

def render_essential_duration(&block)
end

#render_popularity {|source.popularity| ... } ⇒ Object

Yields:

  • (source.popularity)


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

def render_popularity(&block)
  yield(source.popularity)
end

#render_progress_bar {|source.percent_complete| ... } ⇒ Object

Yields:

  • (source.percent_complete)


22
23
24
# File 'app/presenters/content_item_presenter.rb', line 22

def render_progress_bar(&block)
  yield(source.percent_complete) if source.percent_complete.present?
end

#render_time_remaining {|source.time_remaining, source.time_total| ... } ⇒ Object

Yields:

  • (source.time_remaining, source.time_total)


10
11
12
# File 'app/presenters/content_item_presenter.rb', line 10

def render_time_remaining(&block)
  yield(source.time_remaining, source.time_total)
end