Sha256: dd603ea685ae77e366cf77fcd9aeb1c43eeb3b1de64d77a6ec17b4f99c8ce965

Contents?: true

Size: 825 Bytes

Versions: 36

Compression:

Stored size: 825 Bytes

Contents

require 'explicit_delegator'

require_relative 'content_image'

class ContentItemPresenter < ExplicitDelegator
  include ContentImage

  enforce_definitions :name, :url

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

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

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

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

  def render_completed_on(&block)
  end

  def render_elective_points(&block)
  end

  def render_essential_duration(&block)
  end

  def completed_class
    'completed' if source.completed?
  end

  private

  def source
    @delegate
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
woople-theme-0.10.0 app/presenters/content_item_presenter.rb
woople-theme-0.9.0 app/presenters/content_item_presenter.rb
woople-theme-0.8.19 app/presenters/content_item_presenter.rb
woople-theme-0.8.18 app/presenters/content_item_presenter.rb
woople-theme-0.8.17 app/presenters/content_item_presenter.rb
woople-theme-0.8.16 app/presenters/content_item_presenter.rb
woople-theme-0.8.15 app/presenters/content_item_presenter.rb
woople-theme-0.8.14 app/presenters/content_item_presenter.rb
woople-theme-0.8.13 app/presenters/content_item_presenter.rb
woople-theme-0.8.12 app/presenters/content_item_presenter.rb
woople-theme-0.8.11 app/presenters/content_item_presenter.rb
woople-theme-0.8.10 app/presenters/content_item_presenter.rb
woople-theme-0.8.9 app/presenters/content_item_presenter.rb
woople-theme-0.8.8 app/presenters/content_item_presenter.rb
woople-theme-0.8.7 app/presenters/content_item_presenter.rb
woople-theme-0.8.6 app/presenters/content_item_presenter.rb
woople-theme-0.8.5 app/presenters/content_item_presenter.rb
woople-theme-0.8.4 app/presenters/content_item_presenter.rb
woople-theme-0.8.3 app/presenters/content_item_presenter.rb
woople-theme-0.8.2 app/presenters/content_item_presenter.rb