rails/jbuilder — pull request #89 by rwz (2013-01-01 12:19:26+00:00)
Title: Proposal: change the way Jbuilder object is initialized

Right now you can't initialize new Jbuilder object that will say ignore nils, without overriding KeyFormatter.

The only way to do it is something like this:
```ruby
jbuilder = Jbuilder.new # can't use block here
jbuilder.ignore_nil!
```
With this approach you can't use block in the initializer because you have to `ignore_nil!` first.

Proposal would be to change initializer to accept options hash instead of two positional arguments. So you can actually write more expressive code like:
```ruby
Jbuilder.new(ignore_nil: true) do |json|
json.foo 'bar'
end
```

We can even keep the back-compatibility with current API using `extract_options!` along with positioned arguments.