Consistence in the block style

上级 5402b72f
......@@ -159,7 +159,7 @@ def key?(key)
#
# counters.fetch('foo') # => 1
# counters.fetch(:bar, 0) # => 0
# counters.fetch(:bar) {|key| 0} # => 0
# counters.fetch(:bar) { |key| 0 } # => 0
# counters.fetch(:zoo) # => KeyError: key not found: "zoo"
def fetch(key, *extras)
super(convert_key(key), *extras)
......@@ -172,7 +172,7 @@ def fetch(key, *extras)
# hash[:b] = 'y'
# hash.values_at('a', 'b') # => ["x", "y"]
def values_at(*indices)
indices.collect {|key| self[convert_key(key)]}
indices.collect { |key| self[convert_key(key)] }
end
# Returns an exact copy of the hash.
......@@ -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.
......
......@@ -29,7 +29,7 @@ def encode_with(coder)
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册