Class: Interfacer
- Inherits:
-
Object
- Object
- Interfacer
- Defined in:
- lib/interfacer.rb
Instance Method Summary collapse
-
#find_group ⇒ Object
asks user for the group number.
-
#initialize ⇒ Interfacer
constructor
A new instance of Interfacer.
-
#persist(group, file) ⇒ Object
Saves the group into the file.
Constructor Details
#initialize ⇒ Interfacer
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_group ⇒ Object
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
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 |