Module: Tr3llo::Command::Board::Add

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

Instance Method Summary collapse

Instance Method Details

#executeObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/3llo/command/board/add.rb', line 7

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

  interface.print_frame do
    name = interface.input.ask("Name:", required: true)
    desc = interface.input.ask("Description:")

    default_lists =
      interface.input.yes?("With default set of lists to the board (To Do, Doing, Done)?") do |question|
        question.default false
        question.positive "Y"
        question.negative "N"
      end

    API::Board.create(name: name, desc: desc, default_lists: default_lists)

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