Posts tagged ‘ruby 1.9.2’
Example using ruby blocks, lambda and Proc
What really distinguishes ruby from other languages is the syntatic sugar of blocks. For example, blocks really come in handy when iterating thru a collection. The example: (1..10).collect{|i| i*i} => [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] But how does the collect method work? Let’s define an array containing all the prime [...]
How to install RVM with ruby on rails
Learn how to install and configure RVM with both rails 3 and rails 2 apps. RVM allows users to deploy each project with its own self-contained and dedicated environment–from the specific version of ruby all the way down to the precise set of required gems to run the application.