Sha256: 5efc8eb1afce877313a46f82f9bb10a1e6b78e5cd46d6660f8e66104774c1798

Contents?: true

Size: 834 Bytes

Versions: 17

Compression:

Stored size: 834 Bytes

Contents

require 'explicit_delegator'

require_relative 'content_image'

class ContentItemPresenter < ExplicitDelegator
  include ContentImage

  enforce_definitions :image, :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
    __getobj__
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
woople-theme-0.6.11 app/presenters/content_item_presenter.rb
woople-theme-0.6.10 app/presenters/content_item_presenter.rb
woople-theme-0.6.9 app/presenters/content_item_presenter.rb
woople-theme-0.6.8 app/presenters/content_item_presenter.rb
woople-theme-0.6.7 app/presenters/content_item_presenter.rb
woople-theme-0.6.6 app/presenters/content_item_presenter.rb
woople-theme-0.6.5 app/presenters/content_item_presenter.rb
woople-theme-0.6.4 app/presenters/content_item_presenter.rb
woople-theme-0.6.3 app/presenters/content_item_presenter.rb
woople-theme-0.6.2 app/presenters/content_item_presenter.rb
woople-theme-0.6.1 app/presenters/content_item_presenter.rb
woople-theme-0.6 app/presenters/content_item_presenter.rb
woople-theme-0.5.17 app/presenters/content_item_presenter.rb
woople-theme-0.5.16 app/presenters/content_item_presenter.rb
woople-theme-0.5.15 app/presenters/content_item_presenter.rb
woople-theme-0.5.14 app/presenters/content_item_presenter.rb
woople-theme-0.5.13 app/presenters/content_item_presenter.rb