Class: User

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

Constant Summary collapse

@@file_path =
"#{Dir.home}/.academico"

Class Method Summary collapse

Class Method Details

.infoObject



84
85
86
87
88
# File 'lib/academico.rb', line 84

def info
  info = []
  File.open(@@file_path).each_line { |l| info << l.delete("\n") }
  { id: info[0], pass: info[1] }
end

.new(id, pass) ⇒ Object



80
81
82
# File 'lib/academico.rb', line 80

def new(id, pass)
  File.open(@@file_path, 'w') { |f| f.write("#{id}\n#{pass}") }
end