From be1b716d77216449438af094170d4b0f61739cda Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Tue, 24 May 2016 15:40:45 -0700 Subject: [PATCH] Normalize whitespace for Hash#compact documentation [ci skip] This is a similar change that occurred for Hash#except in #21087. --- .../lib/active_support/core_ext/hash/compact.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/activesupport/lib/active_support/core_ext/hash/compact.rb b/activesupport/lib/active_support/core_ext/hash/compact.rb index 5dc9a05ec7..62ea579c65 100644 --- a/activesupport/lib/active_support/core_ext/hash/compact.rb +++ b/activesupport/lib/active_support/core_ext/hash/compact.rb @@ -1,9 +1,9 @@ class Hash # Returns a hash with non +nil+ values. # - # hash = { a: true, b: false, c: nil} - # hash.compact # => { a: true, b: false} - # hash # => { a: true, b: false, c: nil} + # hash = { a: true, b: false, c: nil } + # hash.compact # => { a: true, b: false } + # hash # => { a: true, b: false, c: nil } # { c: nil }.compact # => {} def compact self.select { |_, value| !value.nil? } @@ -11,9 +11,9 @@ class Hash # Replaces current hash with non +nil+ values. # - # hash = { a: true, b: false, c: nil} - # hash.compact! # => { a: true, b: false} - # hash # => { a: true, b: false} + # hash = { a: true, b: false, c: nil } + # hash.compact! # => { a: true, b: false } + # hash # => { a: true, b: false } def compact! self.reject! { |_, value| value.nil? } end