Sha256: 84b54efec7bcc80e3b1f190c33ef85c888de974709ab4ecc9a037d73287cf316

Contents?: true

Size: 573 Bytes

Versions: 3

Compression:

Stored size: 573 Bytes

Contents

module Troo
  class CommentPresenter
    class << self
      def show(card, options = {})
        new(card, options).show
      end
    end

    include DecoratorHelpers

    def initialize(card, options = {})
      @card    = card
      @options = options
    end

    def show
      spacing do
        print card.decorator.short

        print_error "No comments were found." unless card.comments.any?

        card.comments.each do |comment|
          indent { print comment.decorator.as_view }
        end
      end
    end

    private
    attr_reader :card
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
troo-0.0.7 lib/troo/display/comment_presenter.rb
troo-0.0.6 lib/troo/display/comment_presenter.rb
troo-0.0.5 lib/troo/display/comment_presenter.rb