Here is a blog post from a long time ago I never published…Seemed like a shame to leave it that way!
I’ve been slowly (emphasis on slowly) trying to learn Ruby so I can become proficient at Ruby on Rails rather than just following tutorials based on a blog post giving a roadmap for learning Ruby on Rails.
My goal is to learn it well enough to do some simple web applications in Ruby on Rails, but as I got started with Rails I quickly found I was over my head. So after much discouragement, I found this roadmap and I’m trying to accomplish it!
I had made some progress through the book Programming Ruby 1.9, but I got distracted with life, so I’ve kind of forgotten most of what I’ve learned which is very unfortunate. Use it or lose it for me!
So here’s what I’m reviewing today…
Ruby is an object-oriented language, so that means everything is basically an object!
So here is an example:
x = -238
y = x.abs
In this example, the variable x is being set to a negative number, and then the variable y is being set to absolute value of that number. Now in the book the purpose of this is to compare how this differs from what you might do in Java, such as:
x = -238
y = Math.abs(x)
The key difference is you’re able to treat the actual variable as the object and call the ABS function directly on it, rather than using a different object to affect the variable.
And hopefully as it’s 12:30 at night and my mind is starting to go a bit numb from sleepiness, this is accurate!