详细请点击:http://www.verydemo.com/demo_c119_i4514.html
C:\Users\hp>ruby
def say_hello(name)
result="hello,"+name
return result
end
#方法定义完成
puts say_hello("lissdy")
^D
hello,lissdy
first_hash={
"name"=>"123456",
"pwd"=>"pwd123456",
"sex"=>"男",
"age"=>"32"
}
puts "属性数目:#{first_hash.size.to_s}"
first_hash.each do |key,value|
puts key.to_s+":"+value.to_s
end