Skip to content

Commit

Permalink
Prefer fetch for default value
Browse files Browse the repository at this point in the history
Co-authored-by: André Jährling <[email protected]>
  • Loading branch information
afdev82 and andreavocado authored Apr 15, 2024
1 parent 327de7e commit 4454646
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/prawn/grid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ def subdivide(total, num, gutter)

def apply_gutter(options)
if options.key?(:gutter)
@gutter = Float(options[:gutter] || 0.0)
@gutter = Float(options.fetch(:gutter, 0.0))
@row_gutter = @gutter
@column_gutter = @gutter
else
@row_gutter = Float(options[:row_gutter] || 0.0)
@column_gutter = Float(options[:column_gutter] || 0.0)
@row_gutter = Float(options.fetch(:row_gutter, 0.0))
@column_gutter = Float(options.fetch(:column_gutter, 0.0))
@gutter = 0
end
end
Expand Down

0 comments on commit 4454646

Please sign in to comment.