Class: Geera::Commands::List
Instance Attribute Summary
Attributes inherited from Command
#argv, #config, #geera
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
#initialize, #ticket
Class Method Details
.handle?(command) ⇒ Boolean
4
5
6
|
# File 'lib/geera/commands/list.rb', line 4
def self.handle? command
'list' == command
end
|
Instance Method Details
#execute! ⇒ Object
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/geera/commands/list.rb', line 17
def execute!
tickets = geera.list number
if tickets.empty?
puts "No Tickets found"
else
tickets.first(10).each do |ticket|
puts "#{ticket.key.ljust(8)} #{ticket.summary}"
end
end
end
|
#number ⇒ Object
8
9
10
11
12
13
14
15
|
# File 'lib/geera/commands/list.rb', line 8
def number
begin
@number = Integer(super)
rescue ArgumentError
@number = geera.filters.find { |f| f.name == super }.id
end
end
|