Sha256: cdf525e04e3982cec78774fdbc6c68d6c6af931f6fb28092e8403ddf6f5f419a

Contents?: true

Size: 509 Bytes

Versions: 3

Compression:

Stored size: 509 Bytes

Contents

# mixin to provide persistent URL methods
module NewspaperWorks
  module PersistentUrlPresenterBehavior
    # Default for NewspaperContainer and NewspaperArticle,
    # since we don't support ChronAm-style URLs for those object types.
    # Override in individual presenters as needed.
    def persistent_url
      nil
    end

    def persistent_url_attribute
      return nil unless persistent_url
      renderer_for(:persistent_url, {}).new(:persistent_url, persistent_url).render_dl_row
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
newspaper_works-1.0.1 app/presenters/newspaper_works/persistent_url_presenter_behavior.rb
newspaper_works-1.0.0 app/presenters/newspaper_works/persistent_url_presenter_behavior.rb
newspaper_works-0.1.0 app/presenters/newspaper_works/persistent_url_presenter_behavior.rb