Class: TM::Commands::ListAllCommentsForTask

Inherits:
Command
  • Object
show all
Defined in:
lib/tm/commands/list_all_comments_for_task.rb

Instance Method Summary collapse

Methods inherited from Command

#initialize

Constructor Details

This class inherits a constructor from TM::Commands::Command

Instance Method Details

#execute(search_attrs = '') ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/tm/commands/list_all_comments_for_task.rb', line 4

def execute(search_attrs = '')
  project = @provider_handler.taskmapper.project(@attributes)
  ticket = project.tickets(search_attrs.extend(TM::StringExtensions).to_hash).first
  comments = ticket.comments
  @formatter.before(comments.first)
  comments.each do |comment|
    @formatter.format(comment)
  end
  @formatter.after
end