Sha256: 1610809951f2191b76686d76837cabb2b6d017ebd34eadaf3878790a54feae94

Contents?: true

Size: 679 Bytes

Versions: 1

Compression:

Stored size: 679 Bytes

Contents

module Troo
  module Presenters
    class Comment
      include DecoratorHelpers

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

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

      def show
        spacing do
          print card.decorator.short

          print_error 'No comments were found.' unless comments.any?

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

      private

      attr_reader :card

      def comments
        card.comments
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
troo-0.0.8 lib/troo/presenters/comment.rb