mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #24626 from JustinJruby/master
Change the Hash.to_xml with a lamda example
This commit is contained in:
commit
ad955470b7
1 changed files with 1 additions and 1 deletions
|
@ -31,7 +31,7 @@ class Hash
|
||||||
# with +key+ as <tt>:root</tt>, and +key+ singularized as second argument. The
|
# with +key+ as <tt>:root</tt>, and +key+ singularized as second argument. The
|
||||||
# callable can add nodes by using <tt>options[:builder]</tt>.
|
# 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>"
|
# # => "<b>foo</b>"
|
||||||
#
|
#
|
||||||
# * If +value+ responds to +to_xml+ the method is invoked with +key+ as <tt>:root</tt>.
|
# * If +value+ responds to +to_xml+ the method is invoked with +key+ as <tt>:root</tt>.
|
||||||
|
|
Loading…
Reference in a new issue