Class: Abt::Providers::Devops::Services::BoardPicker

Inherits:
Object
  • Object
show all
Defined in:
lib/abt/providers/devops/services/board_picker.rb

Defined Under Namespace

Classes: Result

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cli:, config:) ⇒ BoardPicker

Returns a new instance of BoardPicker.



23
24
25
26
# File 'lib/abt/providers/devops/services/board_picker.rb', line 23

def initialize(cli:, config:)
  @cli = cli
  @config = config
end

Instance Attribute Details

#cliObject (readonly)

Returns the value of attribute cli.



21
22
23
# File 'lib/abt/providers/devops/services/board_picker.rb', line 21

def cli
  @cli
end

#configObject (readonly)

Returns the value of attribute config.



21
22
23
# File 'lib/abt/providers/devops/services/board_picker.rb', line 21

def config
  @config
end

#pathObject (readonly)

Returns the value of attribute path.



21
22
23
# File 'lib/abt/providers/devops/services/board_picker.rb', line 21

def path
  @path
end

Class Method Details

.call(**args) ⇒ Object



17
18
19
# File 'lib/abt/providers/devops/services/board_picker.rb', line 17

def self.call(**args)
  new(**args).call
end

Instance Method Details

#callObject



28
29
30
31
32
33
# File 'lib/abt/providers/devops/services/board_picker.rb', line 28

def call
  @path = ProjectPicker.call(cli: cli).path
  board = cli.prompt.choice("Select a project work board", boards)

  Result.new(board: board, path: path_with_board(team, board))
end