File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -12,18 +12,11 @@ class Jbuilder
1212 @@ignore_nil = false
1313 @@deep_format_keys = false
1414
15- def initialize ( options = nil )
15+ def initialize ( key_formatter : @@key_formatter , ignore_nil : @@ignore_nil , deep_format_keys : @@deep_format_keys )
1616 @attributes = { }
17-
18- if options . nil?
19- @key_formatter = @@key_formatter
20- @ignore_nil = @@ignore_nil
21- @deep_format_keys = @@deep_format_keys
22- else
23- @key_formatter = options [ :key_formatter ]
24- @ignore_nil = options [ :ignore_nil ]
25- @deep_format_keys = options [ :deep_format_keys ]
26- end
17+ @key_formatter = key_formatter
18+ @ignore_nil = ignore_nil
19+ @deep_format_keys = deep_format_keys
2720
2821 yield self if ::Kernel . block_given?
2922 end
Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ class << self
1313 def initialize ( context , options = nil )
1414 @context = context
1515 @cached_root = nil
16- super ( options )
16+
17+ options . nil? ? super ( ) : super ( **options )
1718 end
1819
1920 # Generates JSON using the template specified with the `:partial` option. For example, the code below will render
You can’t perform that action at this time.
0 commit comments