skip to main
|
skip to sidebar
學習 ruby 之路
2009年5月3日 星期日
define a function
class Cat
attr_accessor:name, :size
def bark
puts "bark!!!"
end
end
cat1=Cat.new
cat1.name="putty"
cat1.size=20
puts cat1.name
puts cat1.size
cat1.bark
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
追蹤者
網誌存檔
▼
2009
(12)
▼
5月
(12)
define a array
iteration string
string substitution
interpolation string
character char and value
mutli line in ruby string
loop syntax
if-else syntax
class string method
define a function
define a class inherit another class
Define a class
關於我自己
Unknown
檢視我的完整簡介
沒有留言:
張貼留言