diff options
author | Alex Johnson <notalexjohnson@gmail.com> | 2013-11-12 19:23:42 +0530 |
---|---|---|
committer | Alex Johnson <notalexjohnson@gmail.com> | 2013-11-12 19:23:50 +0530 |
commit | b9a4560d91d382600164e69cf98d8eb6688447df (patch) | |
tree | 2970021a697685640756328885b22a2d8dd0c68b /guides/source/active_support_core_extensions.md | |
parent | 5735a77def338125738c6de9c72961bb4df49513 (diff) | |
download | rails-b9a4560d91d382600164e69cf98d8eb6688447df.tar.gz rails-b9a4560d91d382600164e69cf98d8eb6688447df.tar.bz2 rails-b9a4560d91d382600164e69cf98d8eb6688447df.zip |
[ci skip] Replace #=> with # =>
Diffstat (limited to 'guides/source/active_support_core_extensions.md')
-rw-r--r-- | guides/source/active_support_core_extensions.md | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index b72ebd63ee..69185177b5 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -176,14 +176,14 @@ duplicate = array.dup duplicate.push 'another-string' # the object was duplicated, so the element was added only to the duplicate -array #=> ['string'] -duplicate #=> ['string', 'another-string'] +array # => ['string'] +duplicate # => ['string', 'another-string'] duplicate.first.gsub!('string', 'foo') # first element was not duplicated, it will be changed in both arrays -array #=> ['foo'] -duplicate #=> ['foo', 'another-string'] +array # => ['foo'] +duplicate # => ['foo', 'another-string'] ``` As you can see, after duplicating the `Array` instance, we got another object, therefore we can modify it and the original object will stay unchanged. This is not true for array's elements, however. Since `dup` does not make deep copy, the string inside the array is still the same object. @@ -196,8 +196,8 @@ duplicate = array.deep_dup duplicate.first.gsub!('string', 'foo') -array #=> ['string'] -duplicate #=> ['foo'] +array # => ['string'] +duplicate # => ['foo'] ``` If the object is not duplicable, `deep_dup` will just return it: @@ -1542,7 +1542,7 @@ ActiveSupport::Inflector.inflections do |inflect| inflect.acronym 'SSL' end -"SSLError".underscore.camelize #=> "SSLError" +"SSLError".underscore.camelize # => "SSLError" ``` `camelize` is aliased to `camelcase`. |