Class: Geet::Services::ListIssues

Inherits:
Object
  • Object
show all
Includes:
Geet::Shared::Selection
Defined in:
lib/geet/services/list_issues.rb

Constant Summary

Constants included from Geet::Shared::Selection

Geet::Shared::Selection::MANUAL_LIST_SELECTION_FLAG, Geet::Shared::Selection::SELECTION_MULTIPLE, Geet::Shared::Selection::SELECTION_SINGLE, Geet::Shared::Selection::SKIP_LIST_SELECTION_FLAG

Instance Method Summary collapse

Constructor Details

#initialize(repository, out: $stdout) ⇒ ListIssues

Returns a new instance of ListIssues.



11
12
13
14
# File 'lib/geet/services/list_issues.rb', line 11

def initialize(repository, out: $stdout)
  @repository = repository
  @out = out
end

Instance Method Details

#execute(assignee: nil) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/geet/services/list_issues.rb', line 16

def execute(assignee: nil, **)
  selected_assignee = find_and_select_attributes(assignee) if assignee

  issues = @repository.issues(assignee: selected_assignee)

  issues.each do |issue|
    @out.puts "#{issue.number}. #{issue.title} (#{issue.link})"
  end
end