C
cmdjackryan
As I'm a beginner in Ruby, and just (re)started working on real code,
instead of working through various tutorials, I'm asking myself: Is that
the Ruby way?
Snippet:
unless File.exists?('data/finance.db') == true
setup = Database.new
setup.new_database
else
puts 'Database already exists!'
end
The code is tested and working as expected (Database is my own class,
which creates the database in the first place), and I don't think it
could be (much) shorter.
-Phill
instead of working through various tutorials, I'm asking myself: Is that
the Ruby way?
Snippet:
unless File.exists?('data/finance.db') == true
setup = Database.new
setup.new_database
else
puts 'Database already exists!'
end
The code is tested and working as expected (Database is my own class,
which creates the database in the first place), and I don't think it
could be (much) shorter.
-Phill