Permalink
Browse files

Syntax polishing

  • Loading branch information...
1 parent b57da83 commit 5ad4c8df8dfe77e3e6cd0e6dce38be3a110e5819 @arthurnn arthurnn committed Mar 7, 2014
View
4 activesupport/lib/active_support/hash_with_indifferent_access.rb
@@ -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.
View
2 activesupport/lib/active_support/ordered_hash.rb
@@ -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
View
8 activesupport/test/core_ext/hash_ext_test.rb
@@ -481,30 +481,30 @@ 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
end
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
end
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

0 comments on commit 5ad4c8d

Please sign in to comment.