Sha256: daef73d7580c38636ac051ba7fc03cdd088d1390be3f2d1860dff323bf9c1117

Contents?: true

Size: 527 Bytes

Versions: 22

Compression:

Stored size: 527 Bytes

Contents

require 'explicit_delegator'
require_relative 'content_image'

class PageHeaderPresenter < ExplicitDelegator
  include ContentImage

  enforce_definitions :description

  def title
    name || @delegate.title
  end

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

  def completed_class
    'completed' if @delegate.completed?
  end

  private

  def has_image?
    @delegate.respond_to?(:image)
  end

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

Version data entries

22 entries across 22 versions & 1 rubygems

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