aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-12-07 18:17:49 +0900
committerGitHub <noreply@github.com>2018-12-07 18:17:49 +0900
commitde06d7673eb81fd5d6090e567335daf598790680 (patch)
treead2f7b311e4e62d05675749de4716a3e710f8006
parentf173ec77fc35ce57e94398310308e868689366bb (diff)
parent0086400dd75e73152429f9acf2fce984d8f46e02 (diff)
downloadrails-de06d7673eb81fd5d6090e567335daf598790680.tar.gz
rails-de06d7673eb81fd5d6090e567335daf598790680.tar.bz2
rails-de06d7673eb81fd5d6090e567335daf598790680.zip
Merge pull request #34643 from albertoalmagro/move-type-method-to-symbol
Move type method inside ActionDispatch::Journey::Nodes::Symbol
-rw-r--r--actionpack/lib/action_dispatch/journey/nodes/node.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/journey/nodes/node.rb b/actionpack/lib/action_dispatch/journey/nodes/node.rb
index 32f632800c..086d6a3e07 100644
--- a/actionpack/lib/action_dispatch/journey/nodes/node.rb
+++ b/actionpack/lib/action_dispatch/journey/nodes/node.rb
@@ -65,12 +65,12 @@ module ActionDispatch
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 @@ module ActionDispatch
regexp == DEFAULT_EXP
end
+ def type; :SYMBOL; end
def symbol?; true; end
end