Module: Linear::Commands::ListProjects

Extended by:
ListProjects
Included in:
Linear::Commands, ListProjects
Defined in:
lib/linear/commands/list_projects.rb

Instance Method Summary collapse

Instance Method Details

#list_projects(client: Client.new) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/linear/commands/list_projects.rb', line 6

def list_projects(client: Client.new)
  result = client.query(Queries::PROJECTS)

  projects = result.dig("data", "projects", "nodes") || []
  if projects.empty?
    puts "No projects found"
  else
    Formatters.display_project_list(projects)
  end
end