Sha256: a8cff254e4aa9789639c9fc3d0a557da7498048d940cace7b59a62f78d86aa79

Contents?: true

Size: 432 Bytes

Versions: 3

Compression:

Stored size: 432 Bytes

Contents

# frozen_string_literal: true

class Tramway::Page::PageDecorator < ::Tramway::Core::ApplicationDecorator
  class << self
    def collections
      [:all]
    end
  end

  delegate :title, to: :object

  def lead
    object.body.first 200
  end

  def link
    Tramway::Page::Engine.routes.url_helpers.page_path slug: object.slug
  end

  def public_path
    Tramway::Page::Engine.routes.url_helpers.page_path object.slug
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tramway-page-1.3.1.2 app/decorators/tramway/page/page_decorator.rb
tramway-page-1.3.1.1 app/decorators/tramway/page/page_decorator.rb
tramway-page-1.3.1 app/decorators/tramway/page/page_decorator.rb