fix AS/core_ext examples [ci skip]

This commit is contained in:
Francesco Rodriguez 2012-09-12 19:41:03 -05:00
parent 794a70f944
commit 68a8a298d6
3 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ class Hash
# Returns an <tt>ActiveSupport::HashWithIndifferentAccess</tt> out of its receiver:
#
# { a: 1}.with_indifferent_access['a'] # => 1
# { a: 1 }.with_indifferent_access['a'] # => 1
def with_indifferent_access
ActiveSupport::HashWithIndifferentAccess.new_from_hash_copying_default(self)
end

View File

@ -63,7 +63,7 @@ class Hash
#
# { name: 'Rob', years: '28' }.assert_valid_keys(:name, :age) # => raises "ArgumentError: Unknown key: years"
# { name: 'Rob', age: '28' }.assert_valid_keys('name', 'age') # => raises "ArgumentError: Unknown key: name"
# { name: 'Rob', age: '28' }.assert_valid_keys(:name, :age) # => passes, raises nothing
# { name: 'Rob', age: '28' }.assert_valid_keys(:name, :age) # => passes, raises nothing
def assert_valid_keys(*valid_keys)
valid_keys.flatten!
each_key do |k|

View File

@ -5,7 +5,7 @@ class Hash
#
# is equivalent to
#
# options = { size: 25, velocity: 10}.merge(options)
# options = { size: 25, velocity: 10 }.merge(options)
#
# This is particularly useful for initializing an options hash
# with default values.