aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/hash/conversions.rb
diff options
context:
space:
mode:
authorKD <kd.engineer@yahoo.co.in>2013-11-11 22:31:55 +0530
committerKD <kd.engineer@yahoo.co.in>2013-11-11 22:31:55 +0530
commitbf8b9925f407492894d32205e1f0a103563df4b9 (patch)
treebf2b034d4bccf30d186840ea5f78cb98e8bf9917 /activesupport/lib/active_support/core_ext/hash/conversions.rb
parent4aadd160ff96839e2e87399ab90f85437b1218a8 (diff)
downloadrails-bf8b9925f407492894d32205e1f0a103563df4b9.tar.gz
rails-bf8b9925f407492894d32205e1f0a103563df4b9.tar.bz2
rails-bf8b9925f407492894d32205e1f0a103563df4b9.zip
documentation updated for Hashes [ci skip]
Diffstat (limited to 'activesupport/lib/active_support/core_ext/hash/conversions.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/conversions.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb
index 8930376ac8..2684c772ea 100644
--- a/activesupport/lib/active_support/core_ext/hash/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb
@@ -10,7 +10,7 @@ require 'active_support/core_ext/string/inflections'
class Hash
# Returns a string containing an XML representation of its receiver:
#
- # {'foo' => 1, 'bar' => 2}.to_xml
+ # { foo: 1, bar: 2 }.to_xml
# # =>
# # <?xml version="1.0" encoding="UTF-8"?>
# # <hash>
@@ -43,7 +43,10 @@ class Hash
# end
#
# { foo: Foo.new }.to_xml(skip_instruct: true)
- # # => "<hash><bar>fooing!</bar></hash>"
+ # # =>
+ # # <hash>
+ # # <bar>fooing!</bar>
+ # # </hash>
#
# * Otherwise, a node with +key+ as tag is created with a string representation of
# +value+ as text node. If +value+ is +nil+ an attribute "nil" set to "true" is added.
@@ -201,7 +204,7 @@ module ActiveSupport
end
def become_empty_string?(value)
- # {"string" => true}
+ # { "string" => true }
# No tests fail when the second term is removed.
value['type'] == 'string' && value['nil'] != 'true'
end