Sha256: 3b21a61a776700d3a74564dde27798f40bd6bdf7986166e114040f828707851a

Contents?: true

Size: 433 Bytes

Versions: 27

Compression:

Stored size: 433 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

  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

27 entries across 27 versions & 1 rubygems

Version Path
woople-theme-0.2.25 app/presenters/page_header_presenter.rb
woople-theme-0.2.24 app/presenters/page_header_presenter.rb
woople-theme-0.2.23 app/presenters/page_header_presenter.rb
woople-theme-0.2.22 app/presenters/page_header_presenter.rb
woople-theme-0.2.21 app/presenters/page_header_presenter.rb
woople-theme-0.2.20 app/presenters/page_header_presenter.rb
woople-theme-0.2.19 app/presenters/page_header_presenter.rb
woople-theme-0.2.18 app/presenters/page_header_presenter.rb
woople-theme-0.2.17 app/presenters/page_header_presenter.rb
woople-theme-0.2.16 app/presenters/page_header_presenter.rb
woople-theme-0.2.15 app/presenters/page_header_presenter.rb
woople-theme-0.2.14 app/presenters/page_header_presenter.rb
woople-theme-0.2.13 app/presenters/page_header_presenter.rb
woople-theme-0.2.12 app/presenters/page_header_presenter.rb
woople-theme-0.2.11 app/presenters/page_header_presenter.rb
woople-theme-0.2.10 app/presenters/page_header_presenter.rb
woople-theme-0.2.9 app/presenters/page_header_presenter.rb
woople-theme-0.2.8 app/presenters/page_header_presenter.rb
woople-theme-0.2.7 app/presenters/page_header_presenter.rb
woople-theme-0.2.6 app/presenters/page_header_presenter.rb