mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
docs formatting changes
This commit is contained in:
parent
cfd785f910
commit
752d74f952
3 changed files with 4 additions and 4 deletions
|
@ -97,7 +97,7 @@ module Enumerable
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns true if the enumerable has more than 1 element. Functionally equivalent to enum.to_a.size > 1.
|
# Returns true if the enumerable has more than 1 element. Functionally equivalent to enum.to_a.size > 1.
|
||||||
# Can be called with a block too, much like any?, so people.many? { |p| p.age > 26 } returns true if more than 1 person is over 26.
|
# Can be called with a block too, much like any?, so <tt>people.many? { |p| p.age > 26 }</tt> returns true if more than one person is over 26.
|
||||||
def many?
|
def many?
|
||||||
cnt = 0
|
cnt = 0
|
||||||
if block_given?
|
if block_given?
|
||||||
|
@ -110,7 +110,7 @@ module Enumerable
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# The negative of the Enumerable#include?. Returns true if the collection does not include the object.
|
# The negative of the <tt>Enumerable#include?</tt>. Returns true if the collection does not include the object.
|
||||||
def exclude?(object)
|
def exclude?(object)
|
||||||
!include?(object)
|
!include?(object)
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'active_support/hash_with_indifferent_access'
|
||||||
|
|
||||||
class Hash
|
class Hash
|
||||||
|
|
||||||
# Returns an +ActiveSupport::HashWithIndifferentAccess+ out of its receiver:
|
# Returns an <tt>ActiveSupport::HashWithIndifferentAccess</tt> out of its receiver:
|
||||||
#
|
#
|
||||||
# {:a => 1}.with_indifferent_access["a"] # => 1
|
# {:a => 1}.with_indifferent_access["a"] # => 1
|
||||||
#
|
#
|
||||||
|
|
|
@ -112,7 +112,7 @@ module ActiveSupport
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Merges the instantized and the specified hashes together, giving precedence to the values from the second hash
|
# Merges the instantized and the specified hashes together, giving precedence to the values from the second hash.
|
||||||
# Does not overwrite the existing hash.
|
# Does not overwrite the existing hash.
|
||||||
def merge(hash)
|
def merge(hash)
|
||||||
self.dup.update(hash)
|
self.dup.update(hash)
|
||||||
|
|
Loading…
Reference in a new issue