diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-17 13:36:09 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-17 13:51:39 -0700 |
commit | d12ff4fa50719e5282cb2a357968b9532ddce683 (patch) | |
tree | 6f86891ba91fd905b6be60b1bf24045edd7bb735 /actionpack/lib/action_dispatch/journey/nodes | |
parent | e9777ef62e95be79fee01fea9e7420726d5ff792 (diff) | |
download | rails-d12ff4fa50719e5282cb2a357968b9532ddce683.tar.gz rails-d12ff4fa50719e5282cb2a357968b9532ddce683.tar.bz2 rails-d12ff4fa50719e5282cb2a357968b9532ddce683.zip |
use predicate methods to avoid is_a? checks
we may want to change the name of the class at some point, so it's
better to use a predicate
Diffstat (limited to 'actionpack/lib/action_dispatch/journey/nodes')
-rw-r--r-- | actionpack/lib/action_dispatch/journey/nodes/node.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/journey/nodes/node.rb b/actionpack/lib/action_dispatch/journey/nodes/node.rb index cf6542b370..a2de6ce1c8 100644 --- a/actionpack/lib/action_dispatch/journey/nodes/node.rb +++ b/actionpack/lib/action_dispatch/journey/nodes/node.rb @@ -39,10 +39,12 @@ module ActionDispatch def symbol?; false; end def literal?; false; end + def terminal?; false; end end class Terminal < Node # :nodoc: alias :symbol :left + def terminal?; true; end end class Literal < Terminal # :nodoc: |