Class: Hobostove::Cli::RoomPicker

Inherits:
Object
  • Object
show all
Defined in:
lib/hobostove/cli/room_picker.rb

Instance Method Summary collapse

Constructor Details

#initialize(stdin, stdout) ⇒ RoomPicker

Returns a new instance of RoomPicker.



4
5
6
7
# File 'lib/hobostove/cli/room_picker.rb', line 4

def initialize(stdin, stdout)
  @stdin = stdin
  @stdout = stdout
end

Instance Method Details

#runObject



9
10
11
12
13
14
15
16
17
# File 'lib/hobostove/cli/room_picker.rb', line 9

def run
  @config = YAML.load(File.read(Hobostove::Configuration.config_file))

  if @config.count == 1
    Hobostove::Configuration.current_room = 0
  else
    pick_room
  end
end