Class: FlightPlanCli::Commands::List

Inherits:
Object
  • Object
show all
Includes:
FlightPlanCli::Config
Defined in:
lib/flight_plan_cli/commands/list.rb

Defined Under Namespace

Modules: Color

Instance Method Summary collapse

Constructor Details

#initializeList

Returns a new instance of List.



13
14
15
# File 'lib/flight_plan_cli/commands/list.rb', line 13

def initialize
  read_config
end

Instance Method Details

#processObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/flight_plan_cli/commands/list.rb', line 17

def process
  swimlanes = tickets_by_swimlane
  default_swimlane_ids.each do |swimlane_id|
    next unless swimlanes.key?(swimlane_id)

    print_swimlane(swimlanes[swimlane_id])
  end
rescue ApiUnauthorized
  puts 'Unauthorize. Please ensure your key and secret as setup correctly'.red
rescue Errno::ECONNREFUSED, SocketError => e
  # TODO: caching - low timeout (5s) then fallback to cache
  puts "Network error. #{e.message}".red
end