Skip to content

Commit

Permalink
Make Jbuilder object initialize with single hash
Browse files Browse the repository at this point in the history
  • Loading branch information
rwz committed Oct 12, 2013
1 parent 5deea7c commit 38bf551
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/jbuilder.rb
Expand Up @@ -56,10 +56,9 @@ def self.encode(*args, &block)
@@key_formatter = KeyFormatter.new
@@ignore_nil = false

def initialize(*args, &block)
def initialize(options = {}, &block)
@attributes = {}

options = args.extract_options!
@key_formatter = options.fetch(:key_formatter){ @@key_formatter.clone }
@ignore_nil = options.fetch(:ignore_nil, @@ignore_nil)
yield self if block
Expand Down

0 comments on commit 38bf551

Please sign in to comment.