30 Jun '12, 11pm

Ruby is awesome. Anonymous Class Hacks:

Update: I came across an inlink to this page that was layering in advertisements in a frame. Luckily, there are technical solutions to at least some social problems, and you may now browse again in peace :) If you’ve worked with Ruby for at least a little while, you might already know that classes in Ruby are objects themselves, in particular, instances of Class . Before I get into the fun stuff, let’s quickly recap what that means. Here’s the ordinary way we define classes, as you all have seen. class Point def initialize(x,y) @x, @y = x,y end attr_reader :x, :y def distance(point) Math.hypot(point.x - x, point.y - y) end end The interesting thing is that the previous definition is essentially functionally equivalent to the following: Point = Class.new do def initialize(x,y) @x, @y = x,y end attr_reader :x, :y def distance(point) Math.hypot(point.x - x, point.y - y) end e...

Full article: http://blog.rubybestpractices.com/posts/gregory/anonymous...

Tweets

Best Ruby Guide, Ruby Tutorial:

rubylearning.com 01 Jul '12, 12pm

# p014constructs.rb # In Ruby, nil and false evaluate to false, # everything else (including true, 0) means true # nil is ...

Ruby Best Practices - Practicing Ruby, The News...

blog.rubybestpractices.com 03 Jul '12, 4am

Welcome, Hacker News folks. If you find the following project worthwhile, I’d really appreciate an up vote so that I can r...

Shades of Gray: Articles in Higher-Order Ruby:

blog.grayproductions.net 01 Jul '12, 11am

James Edward Gray II joined the Ruby community in 2004 and they just haven't been able to get rid of him since then. James...

下载 Ruby - Ruby 官方网站:

ruby-lang.org 02 Jul '12, 7am

在这里可以下载到适合您的最新的 Ruby 版本,当前稳定的版本是 1.9.3 。下载前请先阅读 Ruby 开源许可 。 Ruby 源代码 如果您欲使之与您的平台更为兼容或者需要专一设置您的环境,那么从源代码安装是最好的解决方案。如果有预先做好的...

@notquitePre Awesome, just followed you. Check out

runaddicts.net 01 Jul '12, 10am

Let’s start with this: WE LOVE YOU! RunAddicts.net relies on the submissions of guest authors to continue it’s existence. ...

More from Ruby Under a Microscope

rubyflow.com 29 Jun '12, 4pm

More from Ruby Under a Microscope Posted by patshaughnessy on June 29, 2012 — 0 comments This is an eBook I’m writing this...

Ruby Internals: Method Definition

rubyflow.com 02 Jul '12, 1am

Ruby Internals: Method Definition Posted by oscardb on July 02, 2012 — 0 comments Learn what happens behind the scenes whe...

@parndt I really want refine/using: /cc @mariov...

yehudakatz.com 04 Jul '12, 5am

The first thing you need to understand is that the purpose of refinements in Ruby 2.0 is to make monkey-patching safer. Sp...

Ruby ActiveRecord and MySQL: Ruby Study Notes -...

rubylearning.com 08 Jul '12, 12pm

We shall look at code examples explaining how to connect to a MySQL database using Ruby and ActiveRecord . ActiveRecord Ra...

@mattwynne @philip_roberts No, it's going to ch...

yehudakatz.com 04 Jul '12, 4pm

en: errors: # The default format use in full error messages. format: "{{attribute}} {{message}}" # The values :model, :att...

For all the Russian-speaking devs Ruby OpenSour...

rubyflow.ru 02 Jul '12, 9am

Пока все мы с нетерпением ждем нового рауда Rails Rumble , появилась возможность посостязаться и даже получить классные пр...

GET .ME FOR FREE :) get a free .ME #domain w/ #...

dynadot.com 05 Jul '12, 6pm

Why should I register a .ME domain? The .ME domain extension can be used as YOUR personal home on the internet. It is perf...

#164 Cron in Ruby - RailsCasts:

railscasts.com 01 Jul '12, 8pm

Cron is great for handling recurring tasks, but it is an external dependency with a crazy syntax. In this episode I show y...

Looking for fun ways to cook with the kids this...

healthychild.org 29 Jun '12, 10pm

Tristin and Tyler use their magic to bring Serena Norr to the kitchen to make yummy Granola Bars. Submitted by: Tristin & ...

SSH Tunneling in Ruby // RailsTips by John Nune...

railstips.org 01 Jul '12, 10am

The other day I wanted to do some queries in production, but our servers are pretty locked down to the outside world. I wa...