Class: TempestTime::Commands::Teams::Add
- Inherits:
-
TempestTime::Command
- Object
- TempestTime::Command
- TempestTime::Commands::Teams::Add
- Defined in:
- lib/tempest_time/commands/teams/add.rb
Instance Method Summary collapse
- #execute(input: $stdin, output: $stdout) ⇒ Object
-
#initialize(options) ⇒ Add
constructor
A new instance of Add.
Methods inherited from TempestTime::Command
#command, #pastel, #prompt, #spinner, #table, #with_spinner, #with_success_fail_spinner
Constructor Details
#initialize(options) ⇒ Add
Returns a new instance of Add.
10 11 12 |
# File 'lib/tempest_time/commands/teams/add.rb', line 10 def initialize() @options = end |
Instance Method Details
#execute(input: $stdin, output: $stdout) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/tempest_time/commands/teams/add.rb', line 14 def execute(input: $stdin, output: $stdout) teams = TempestTime::Settings::Teams = 'Please enter ' + pastel.green('the members') + " of this team. "\ '(Comma-separated, e.g. jkirk, jpicard, bsisko, kjaneway) ' members = prompt.ask() do |q| q.convert ->(input) { input.split(/,\s*/) } end name = prompt.ask('Please enter ' + pastel.green('the name') + ' of your new team.') teams.update(name, members) prompt.say(pastel.green('Success!')) end |