Class: IdonethisCli::Team

Inherits:
Command
  • Object
show all
Defined in:
lib/idonethis_cli/team.rb

Instance Method Summary collapse

Instance Method Details

#currentObject



33
34
35
# File 'lib/idonethis_cli/team.rb', line 33

def current
  cli.say "#{settings.team['name']}"
end

#listObject



7
8
9
10
11
12
13
# File 'lib/idonethis_cli/team.rb', line 7

def list
  return nil unless authenticated?

  teams.each.with_index(1) do |team, idx|
    cli.say "#{idx}. #{team['name']}"
  end
end

#setObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/idonethis_cli/team.rb', line 17

def set
  return nil unless authenticated?

  cli.choose do |menu|
    menu.prompt = "Please select the team you wish to set:"
    teams.each do |team|
      menu.choice(team['name']) do
        cli.say("#{team['name']} set")
        settings.set_team(team)
      end
    end
  end
end