Category Archives: Ruby

Ruby programming language related content

Delegation in Ruby

This is my first article in http://railsmagazine.com, it was published in issue 1, so basically I’m just republishing it here again. “Separate changeable parts from others that remain the same” and “composition is preferred to inheritance” are 2 common design … Continue reading

Posted in Grails, Ruby | Tagged , , | 4 Comments

C++ passes by reference, Java and Ruby don’t

I got a lot of comments for the previous article, that was explaining how Ruby passes by value, just like Java does. I thought that showing a simple example implemented in C++, Java and Ruby will clarify the idea. In … Continue reading

Posted in C++, Java, Ruby | Tagged , | 141 Comments

Ruby, pass by value or by reference?

It’s a basic question that I myself had a problem with when i started using Ruby: Does Ruby pass by value or by reference? Well, if you want a direct answer, then: Ruby passes by value. It’s a similar behavior … Continue reading

Posted in Ruby | Tagged , | 38 Comments

The power of JRuby

It’s true that I’m not the qualified guy to talk about Java’s power,as it has been 2 years since i last practiced it, but i feel like i have to communicate my thoughts to the people that didn’t give JRuby … Continue reading

Posted in Java, JRuby, Ruby | Tagged , , | 27 Comments

Ruby symbols

I keep seeing many programmers from different backgrounds are unable to get what Ruby symbols are, and though I do know that there are many great posts regarding this topic, and actually my intent is not to increase them by … Continue reading

Posted in Ruby | Tagged , | 48 Comments

Ruby and Metaprogramming

According to wikipedia, Metaprogramming: is the writing of computer programs that write or manipulate other programs (or themselves) as their data, or that do part of the work at runtime that would otherwise be done at compile time. Well, nice … Continue reading

Posted in Ruby | 5 Comments

Ruby and Internal DSLs

A Domain-specific language(DSL) is a computer language that’s targeted to a particular kind of problem, rather than a general purpose language that’s aimed at any kind of software problem. Domain specific languages have been talked about, and used for almost … Continue reading

Posted in Ruby | Tagged , , | 8 Comments

Ruby callbacks

This blog post is about ruby’s callbacks(hooks): what are the available ones,and how practically we can use them? method_missing obj.method_missing(symbol [, *args] ) => result might be the most famous hook in ruby, and is being used a lot by … Continue reading

Posted in Ruby | 9 Comments

Ruby reflection 2

This is the second post related to ruby’s reflection API, the previous post was an extensive intro to this topic. While the current one will be lighter somehow, it would require you to focus a bit more on the content. … Continue reading

Posted in Ruby | Tagged , , | 3 Comments

Ruby reflection

If you are here, then most probably you want to know more about ruby reflection interface. Well that’s true, but I always find myself in need to explain few things before I get started with my posts, and this time … Continue reading

Posted in Ruby | Tagged , | 16 Comments