Class: GitScf::Show

Inherits:
Object
  • Object
show all
Defined in:
lib/git_scf/subcommands/show.rb

Instance Method Summary collapse

Constructor Details

#initialize(ticket, verbose) ⇒ Show

Returns a new instance of Show.



4
5
6
7
# File 'lib/git_scf/subcommands/show.rb', line 4

def initialize(ticket, verbose)
  @ticket = ticket
  @verbose = verbose
end

Instance Method Details

#executeObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/git_scf/subcommands/show.rb', line 9

def execute
  jira_ticket = @ticket.jira_ticket
  puts "Summary: #{jira_ticket.summary}"
puts "Status: #{jira_ticket.status.name}"
puts "Created at: #{jira_ticket.created}"
if @verbose
  puts "Description: #{jira_ticket.description}"
  jira_ticket.comments.each do |comment|
    puts ""
    puts "#{comment.author['name']} wrote: #{comment.body}"
  end
end
end