Class: Interfacer

Inherits:
Object
  • Object
show all
Defined in:
lib/interfacer.rb

Instance Method Summary collapse

Constructor Details

#initializeInterfacer

Returns a new instance of Interfacer.



4
5
6
# File 'lib/interfacer.rb', line 4

def initialize
  @cli_handler = HighLine.new
end

Instance Method Details

#find_groupObject

asks user for the group number



9
10
11
# File 'lib/interfacer.rb', line 9

def find_group
 @cli_handler.ask "Please enter your group number(will be set as default).".colorize(:red)
end

#persist(group, file) ⇒ Object

Saves the group into the file

Parameters:

  • group

    group number in inteder

  • file

    path of file



16
17
18
19
20
# File 'lib/interfacer.rb', line 16

def persist(group, file)
 File.open(file,'w') do |f|
  f.write(group)
 end
end