Class: Jira::Command::Attachments
- Defined in:
- lib/jira/commands/attachments.rb
Instance Attribute Summary collapse
-
#ticket ⇒ Object
Returns the value of attribute ticket.
Instance Method Summary collapse
-
#initialize(ticket) ⇒ Attachments
constructor
A new instance of Attachments.
- #run ⇒ Object
Constructor Details
#initialize(ticket) ⇒ Attachments
Returns a new instance of Attachments.
16 17 18 |
# File 'lib/jira/commands/attachments.rb', line 16 def initialize(ticket) self.ticket = ticket end |
Instance Attribute Details
#ticket ⇒ Object
Returns the value of attribute ticket.
14 15 16 |
# File 'lib/jira/commands/attachments.rb', line 14 def ticket @ticket end |
Instance Method Details
#run ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/jira/commands/attachments.rb', line 20 def run return if ticket.empty? return if .empty? return if ['fields'].nil? =['fields']['attachment'] if !.nil? and .count > 0 .each do || name=['filename'] url=['content'] puts "#{Jira::Format.user(name)} #{url}" end else puts "No attachments found for ticket #{ticket}." end end |