Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Syntax polishing

  • Loading branch information...
commit 5ad4c8df8dfe77e3e6cd0e6dce38be3a110e5819 1 parent b57da83
Arthur Nogueira Neves arthurnn authored
4 activesupport/lib/active_support/hash_with_indifferent_access.rb
View
@@ -228,11 +228,11 @@ def deep_symbolize_keys; to_hash.deep_symbolize_keys end
def to_options!; self end
def select(*args, &block)
- dup.tap { |hash| hash.select!(*args, &block)}
+ dup.tap { |hash| hash.select!(*args, &block) }
end
def reject(*args, &block)
- dup.tap { |hash| hash.reject!(*args, &block)}
+ dup.tap { |hash| hash.reject!(*args, &block) }
end
# Convert to a regular hash with string keys.
2  activesupport/lib/active_support/ordered_hash.rb
View
@@ -33,7 +33,7 @@ def select(*args, &block)
end
def reject(*args, &block)
- dup.tap { |hash| hash.reject!(*args, &block)}
+ dup.tap { |hash| hash.reject!(*args, &block) }
end
def nested_under_indifferent_access
8 activesupport/test/core_ext/hash_ext_test.rb
View
@@ -481,7 +481,7 @@ def test_indifferent_deleting
end
def test_indifferent_select
- hash = ActiveSupport::HashWithIndifferentAccess.new(@strings).select {|k,v| v == 1}
+ hash = ActiveSupport::HashWithIndifferentAccess.new(@strings).select { |_ ,v| v == 1 }
assert_equal({ 'a' => 1 }, hash)
assert_instance_of ActiveSupport::HashWithIndifferentAccess, hash
@@ -489,14 +489,14 @@ def test_indifferent_select
def test_indifferent_select_bang
indifferent_strings = ActiveSupport::HashWithIndifferentAccess.new(@strings)
- indifferent_strings.select! {|k,v| v == 1}
+ indifferent_strings.select! { |_, v| v == 1 }
assert_equal({ 'a' => 1 }, indifferent_strings)
assert_instance_of ActiveSupport::HashWithIndifferentAccess, indifferent_strings
end
def test_indifferent_reject
- hash = ActiveSupport::HashWithIndifferentAccess.new(@strings).reject {|k,v| v != 1}
+ hash = ActiveSupport::HashWithIndifferentAccess.new(@strings).reject { |_, v| v != 1 }
assert_equal({ 'a' => 1 }, hash)
assert_instance_of ActiveSupport::HashWithIndifferentAccess, hash
@@ -504,7 +504,7 @@ def test_indifferent_reject
def test_indifferent_reject_bang
indifferent_strings = ActiveSupport::HashWithIndifferentAccess.new(@strings)
- indifferent_strings.reject! {|k,v| v != 1}
+ indifferent_strings.reject! { |_, v| v != 1 }
assert_equal({ 'a' => 1 }, indifferent_strings)
assert_instance_of ActiveSupport::HashWithIndifferentAccess, indifferent_strings
Please sign in to comment.
Something went wrong with that request. Please try again.