Skip to content
代码片段 群组 项目
未验证 提交 481cad2c 编辑于 作者: Ash McKenzie's avatar Ash McKenzie
浏览文件

DRY up the creation of key

上级 4b6796aa
No related branches found
No related tags found
无相关合并请求
......@@ -92,9 +92,10 @@ def build
private
def method_missing(name, *arguments, value: nil, description: nil, &block)
raise KeyCollisionError, "'#{key}' collides with an existing enum key!" if @definition[name.downcase.to_sym]
key = name.downcase.to_sym
raise KeyCollisionError, "'#{key}' collides with an existing enum key!" if @definition[key]
@definition[name.downcase.to_sym] = {
@definition[key] = {
value: value,
description: description
}
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册