ccocchi/rabl-rails — pull request #8 by ccocchi (2012-10-05 12:04:27+00:00)
Title: Allow conditionnal blocks within template

To replace `if` and `unless` within template we introduce the `condition` keyword. It takes a proc (that take the current object rendered) as argument and a block. The block is parsed at compile time.

The source compiled from the block will be called if the proc is evaluated as true at rendering time. Here's a use example

```ruby
object :@user

attributes :name
condition(->(u) { u == current_user }) do
attributes :secret
end
```