aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Moss <maclover7@users.noreply.github.com>2016-04-19 09:22:46 -0400
committerJon Moss <maclover7@users.noreply.github.com>2016-04-19 09:22:46 -0400
commitad955470b7e66f7ca1105bb239fec9ee024c5ec0 (patch)
tree7fa1f788627562adc05b4bc96a70d70e396090ac
parent976410709997b69a2c33fd912a8665d85ab1f2c9 (diff)
parentb00c69cd1f0b0143ad8e6b92c982c106845583c7 (diff)
downloadrails-ad955470b7e66f7ca1105bb239fec9ee024c5ec0.tar.gz
rails-ad955470b7e66f7ca1105bb239fec9ee024c5ec0.tar.bz2
rails-ad955470b7e66f7ca1105bb239fec9ee024c5ec0.zip
Merge pull request #24626 from JustinJruby/master
Change the Hash.to_xml with a lamda example
-rw-r--r--activesupport/lib/active_support/core_ext/hash/conversions.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb
index 6741e732f0..dd5ebe6d8d 100644
--- a/activesupport/lib/active_support/core_ext/hash/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb
@@ -31,7 +31,7 @@ class Hash
# with +key+ as <tt>:root</tt>, and +key+ singularized as second argument. The
# callable can add nodes by using <tt>options[:builder]</tt>.
#
- # 'foo'.to_xml(lambda { |options, key| options[:builder].b(key) })
+ # {foo: lambda { |options, key| options[:builder].b(key) }}.to_xml
# # => "<b>foo</b>"
#
# * If +value+ responds to +to_xml+ the method is invoked with +key+ as <tt>:root</tt>.