Class: Rubyists::Linear::CLI::Issue::Take

Inherits:
Object
  • Object
show all
Includes:
CommonOptions, Rubyists::Linear::CLI::Issue, SemanticLogger::Loggable
Defined in:
lib/linear/commands/issue/take.rb

Overview

The Take class is a Dry::CLI::Command that assigns an issue to yourself

Constant Summary

Constants included from Rubyists::Linear::CLI::Issue

ALIASES, DESCRIPTION

Constants included from WhatFor

WhatFor::ALLOWED_PR_TYPES, WhatFor::PR_TYPES, WhatFor::PR_TYPE_SELECTIONS

Instance Method Summary collapse

Methods included from Rubyists::Linear::CLI::Issue

#attach_project, #cancel_issue, #close_issue, #create_pr!, #gimme_da_issue!, #issue_comment, #issue_pr, #make_da_issue!, #update_issue

Methods included from SubCommands

#ask_for_team, #branch_for, #choose_a_team!, #current_branch, #default_branch, #git, included, #prompt, #pull_or_push_new_branch!

Methods included from WhatFor

#ask_for_projects, #ask_or_edit, #cancelled_state_for, #comment_for, #completed_state_for, #description_for, #editor_for, #labels_for, #pr_description_for, #pr_scope_for, #pr_title_for, #pr_type_for, #project_for, #project_scores, #reason_for, #team_for, #title_for

Methods included from CommonOptions

#display, included

Instance Method Details

#call(issue_ids:, **options) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/linear/commands/issue/take.rb', line 22

def call(issue_ids:, **options)
  updates = issue_ids.map do |issue_id|
    Rubyists::Linear::Issue.find(issue_id)
    gimme_da_issue! issue_id # gimme_da_issue! is defined in Rubyists::Linear::CLI::Issue
  rescue NotFoundError => e
    logger.warn e.message
    next
  end.compact
  display updates, options
end