提交 bb295be3 编写于 作者: K Kasper Timm Hansen

Replace delegate calls with standard method defs.

Spares a to_sym call by aliasing to_sym to ref.

Then the delegate felt meager for one method; ditch and define method ourselves.
上级 f48098bd
......@@ -28,12 +28,15 @@ def initialize(symbol)
@symbol = symbol.to_sym
end
delegate :to_s, :to_sym, :to => :symbol
def to_s
@symbol.to_s
end
alias to_str to_s
def ref
@symbol
end
alias to_sym ref
def ==(type)
@symbol == type.to_sym unless type.blank?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册