<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>allchild</title>
    <link>https://ruby-china.org/allchild</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>ruby 新手打破砂锅的一个问题</title>
      <description>&lt;p&gt;20 分钟体验 ruby 里的一个例子，例子很简单，写一个函数
def h(name="World")
puts "Hello #{name.capitalize}"
end
问题是，如果把函数写成 def h(name="world") 则会报这样的错误
Error: undefined method `capitallize' for "world":String
这是为什么呢。即使 name 默认值为 world，不会执行 name.capitalize 将 world 转换为大写么。&lt;/p&gt;

&lt;p&gt;感谢您看到我的帖子，不管您有没有回答，我都谢谢您。如果您能替我解惑，我会感激万分。任何稍微的点拨，都是对新手的雪中送炭。  &lt;/p&gt;</description>
      <author>allchild</author>
      <pubDate>Tue, 20 Dec 2011 22:19:38 +0800</pubDate>
      <link>https://ruby-china.org/topics/542</link>
      <guid>https://ruby-china.org/topics/542</guid>
    </item>
  </channel>
</rss>
