Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
f3409dc0
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f3409dc0
编写于
7月 26, 2010
作者:
N
Neeraj Singh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
polishing comments
上级
d2149256
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
8 deletion
+8
-8
activesupport/lib/active_support/core_ext/array/conversions.rb
...esupport/lib/active_support/core_ext/array/conversions.rb
+5
-5
activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
...b/active_support/core_ext/class/inheritable_attributes.rb
+3
-3
未找到文件。
activesupport/lib/active_support/core_ext/array/conversions.rb
浏览文件 @
f3409dc0
...
...
@@ -58,12 +58,12 @@ def to_formatted_s(format = :default)
alias_method
:to_default_s
,
:to_s
alias_method
:to_s
,
:to_formatted_s
# Returns a string that represents th
is array in XML by send
ing +to_xml+
#
to
each element. Active Record collections delegate their representation
# Returns a string that represents th
e array in XML by invok
ing +to_xml+
#
on
each element. Active Record collections delegate their representation
# in XML to this method.
#
# All elements are expected to respond to +to_xml+, if any of them does
# not an exception is raised.
# not
then
an exception is raised.
#
# The root node reflects the class name of the first element in plural
# if all elements belong to the same type and that's not Hash:
...
...
@@ -115,8 +115,8 @@ def to_formatted_s(format = :default)
# <?xml version="1.0" encoding="UTF-8"?>
# <projects type="array"/>
#
# By default
root children have as node name the one of the root
#
singularized.
You can change it with the <tt>:children</tt> option.
# By default
name of the node for the children of root is <tt>root.singularize</tt>.
# You can change it with the <tt>:children</tt> option.
#
# The +options+ hash is passed downwards:
#
...
...
activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
浏览文件 @
f3409dc0
require
'active_support/core_ext/object/duplicable'
require
'active_support/core_ext/array/extract_options'
# Retain for backward compatibility. Methods are now included in Class.
# Retain
ed
for backward compatibility. Methods are now included in Class.
module
ClassInheritableAttributes
# :nodoc:
end
# Allows attributes to be shared within an inheritance hierarchy
, but where e
ach descendant gets a copy of
# Allows attributes to be shared within an inheritance hierarchy
. E
ach descendant gets a copy of
# their parents' attributes, instead of just a pointer to the same. This means that the child can add elements
# to, for example, an array without those additions being shared with either their parent, siblings, or
# children
, which
is unlike the regular class-level attributes that are shared across the entire hierarchy.
# children
. This
is unlike the regular class-level attributes that are shared across the entire hierarchy.
#
# The copies of inheritable parent attributes are added to subclasses when they are created, via the
# +inherited+ hook.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录