提交 00de46ac 编写于 作者: D Daniel Colson

Use singular define_attribute_method

`define_attribute_methods` splats the arguments,
then calls out to `define_attribute_method` for
each. When defining a singule attribute, using
the singular version of the method saves us an
array and an extra method call.
上级 a19e91f0
......@@ -23,7 +23,7 @@ def attribute(name, type = Type::Value.new, **options)
end
self.attribute_types = attribute_types.merge(name => type)
define_default_attribute(name, options.fetch(:default, NO_DEFAULT_PROVIDED), type)
define_attribute_methods(name)
define_attribute_method(name)
end
private
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册