未验证 提交 de06d767 编写于 作者: R Ryuta Kamizono 提交者: GitHub

Merge pull request #34643 from albertoalmagro/move-type-method-to-symbol

Move type method inside ActionDispatch::Journey::Nodes::Symbol
......@@ -65,12 +65,12 @@ def initialize(x = Object.new)
def literal?; false; end
end
%w{ Symbol Slash Dot }.each do |t|
class_eval <<-eoruby, __FILE__, __LINE__ + 1
class #{t} < Terminal;
def type; :#{t.upcase}; end
end
eoruby
class Slash < Terminal # :nodoc:
def type; :SLASH; end
end
class Dot < Terminal # :nodoc:
def type; :DOT; end
end
class Symbol < Terminal # :nodoc:
......@@ -89,6 +89,7 @@ def default_regexp?
regexp == DEFAULT_EXP
end
def type; :SYMBOL; end
def symbol?; true; end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册