Sha256: fec3fd9b97843ac4c8f89601fdd3066d21c6dbb6cf8fa27fc06dd6b68a77bb46

Contents?: true

Size: 440 Bytes

Versions: 1

Compression:

Stored size: 440 Bytes

Contents

module Hitchens
  class PostDecorator < ApplicationDecorator
    decorates 'Hitchens::Post'

    def body_to_html
      markdown(body)
    end

    def pubdate_tag
      if publication_date
        h.time_tag publication_date, pubdate_display, pubdate: true
      else
        "(not yet published)"
      end
    end

  private
    def pubdate_display
      publication_date.getlocal.strftime("%A, %B %e, %Y at %l:%M %p")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hitchens-0.0.1 app/decorators/hitchens/post_decorator.rb