设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
12
返回列表 发新帖
楼主: 阿单同学
打印 上一主题 下一主题

ruby问题.def 方法名=()

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
60
在线时间
1 小时
注册时间
2005-11-29
帖子
141
11
发表于 2007-12-19 08:43:49 | 只看该作者
ps:

attr_ reader :motherland



def motherland
return @motherland
end

是等价的。

attr_accessor :motherland

相当于

attr_reader:motherland
attr_writer :motherland


系统信息:本贴获得楼主认可,66RPG感谢您的热情解答~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

月下可怜人

梦石
0
星屑
50
在线时间
10 小时
注册时间
2005-11-23
帖子
4085

第1届短篇游戏比赛亚军

12
发表于 2007-12-19 09:34:46 | 只看该作者
以下引用bbschat于2007-12-19 0:43:49的发言:

ps:

attr_ reader :motherland



def motherland
return @motherland
end

是等价的。

attr_accessor :motherland

相当于

attr_reader:motherland
attr_writer :motherland




[本贴由作者于 2007-12-19 0:47:07 最后编辑]


又试了很久,
仍然没找到,
算了,可能记错了{/gg}
纵然千里外,我等雁归来。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2026-6-21 18:05

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表