lib/troo/display/comment_presenter.rb in troo-0.0.4 vs lib/troo/display/comment_presenter.rb in troo-0.0.5

- old
+ new

@@ -1,31 +1,27 @@ module Troo class CommentPresenter class << self - def render_show(card, options = {}) - new(card, options).render_show + def show(card, options = {}) + new(card, options).show end end include DecoratorHelpers def initialize(card, options = {}) @card = card @options = options end - def render_show + def show spacing do - print CardDecorator.new(card).short + print card.decorator.short - if card.comments.any? - card.comments.each do |comment| - indent do - print CommentDecorator.new(comment).as_view - end - end - else - print_error "No comments were found." + 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