I did Codecademy and I'm doing Odin. Codecademy is just to get the basics of the language. The Odin Project is a full path to web development. The best is to start from the beginning and don't skip anything.
If you want to go to a bootcamp, maybe doing the introduction and the Web Development 101 sections is enough.
Are you familiar with regular expressions? Here's a bit of a primer with Ruby examples: http://www.tutorialspoint.com/ruby/ruby_regular_expressions.htm. Using regular expressions you could check the string to see whether it is only composed of numbers. Looking at the Ruby docs for strings will give you a lot of insight into what you can do. For example, the regular expression match function: http://www.ruby-doc.org/core-2.1.2/String.html#method-i-match
A bad solution, but one that would work with the exercise's current code is to add to the if statement. Instead of only checking for "0" and "1", add a check for the numbers 2-9. This is pretty ugly though.
Finally, searching for "ruby string is numeric" on Google returns some good Stack Overflow results. However, make sure you understand what all the parts are doing. A lot of the answers include things such as "=~" and exception handling.
Hey try this!
It would be nice to use rbenv or rvm. This tutorial uses rbenv and works great! But follow what I put in the EDIT section instead
https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-centos-7
Enjoy having ruby!
EDIT: Instead of the tutorial, here are the steps needed to just get ruby:
sudo yum install -y git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel
cd git clone git://github.com/sstephenson/rbenv.git .rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile echo 'eval "$(rbenv init -)"' >> ~/.bash_profile exec $SHELL
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile exec $SHELL
source ~/.bash_profile
You will more than likely want ruby 2.3.0 so go ahead and do:
rbenv install 2.3.0 rbenv global 2.3.0 rbenv rehash
Now you will have have ruby 2.3.0
Also really good tools are going to be:
gem install bundler && gem install pry
Pry is like irb but also acts as a debugger and has syntax highlighting!
It is for beginners. Hackerrank is a programming challenge website. One thing they're doing is 30 days of programming. It is in many different languages. You pick a language, and it gives you a challenge, one a day. I am explaining my solutions to the challenge, using Ruby. The challenges do appear to be for beginners. However, there isn't much text to explain how to learn a particular language. The website assumes you'll learn it elsewhere. I'm trying to explain it to a beginner, but we'll see how well that goes.
Here's one potential solution: regexr.com/4dvdi
​
Basically, capturing the text inside the braces. Plug that regex into your script and you should be off to the races.
yes , that is the one . I've also picked up a copy of wicked. cool Ruby scripts. http://www.amazon.com/Wicked-Cool-Ruby-Scripts-Difficult/dp/1593271824
Both are great reading material but are a little dated .
I read that after CodeCademy. It's dry, but it's amazing.
I just purchased Eloquent and am yet to go through it.