Sha256: 88f36aefcf9baf8cf4ee106a8d7b253784484075d68ce0764c74ac3a58ad040f

Contents?: true

Size: 499 Bytes

Versions: 66

Compression:

Stored size: 499 Bytes

Contents

require 'delegate'
require_relative 'content_image'

class PageHeaderPresenter < SimpleDelegator
  include ContentImage

  def title
    name || header.title
  end

  def image_class
    'page-header-with-image' if has_image?
  end

  def completed_class
    'completed' if header.completed?
  end

  private

  def has_image?
    header.respond_to?(:image)
  end

  def name
    if header.respond_to?(:name)
      header.name
    else
      nil
    end
  end

  def header
    __getobj__
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

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