Module: Tr3llo::Command::Label::Add

Extended by:
Add
Included in:
Add
Defined in:
lib/3llo/command/label/add.rb

Instance Method Summary collapse

Instance Method Details

#execute(board_id) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/3llo/command/label/add.rb', line 7

def execute(board_id)
  interface = Application.fetch_interface!()

  interface.print_frame do
    name = interface.input.ask("Name:", required: true)
    color = interface.input.select("Choose the color:", Utils::TRELLO_LABEL_COLOR)

    API::Label.create(name: name, color: color, board_id: board_id)

    interface.puts("Label has been created.")
  end
end