Class: ActionDispatch::Journey::Nodes::Symbol
- Defined in:
- lib/action_dispatch/journey/nodes/node.rb
Overview
:nodoc:
Constant Summary collapse
- DEFAULT_EXP =
/[^\.\/\?]+/
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#regexp ⇒ Object
(also: #symbol)
Returns the value of attribute regexp.
Attributes inherited from Node
Instance Method Summary collapse
- #default_regexp? ⇒ Boolean
-
#initialize(left) ⇒ Symbol
constructor
A new instance of Symbol.
- #symbol? ⇒ Boolean
Methods inherited from Terminal
Methods inherited from Node
#cat?, #each, #group?, #literal?, #star?, #terminal?, #to_dot, #to_s, #to_sym, #type
Constructor Details
#initialize(left) ⇒ Symbol
Returns a new instance of Symbol.
80 81 82 83 84 |
# File 'lib/action_dispatch/journey/nodes/node.rb', line 80 def initialize(left) super @regexp = DEFAULT_EXP @name = left.tr '*:'.freeze, ''.freeze end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
77 78 79 |
# File 'lib/action_dispatch/journey/nodes/node.rb', line 77 def name @name end |
#regexp ⇒ Object Also known as: symbol
Returns the value of attribute regexp.
75 76 77 |
# File 'lib/action_dispatch/journey/nodes/node.rb', line 75 def regexp @regexp end |
Instance Method Details
#default_regexp? ⇒ Boolean
86 87 88 |
# File 'lib/action_dispatch/journey/nodes/node.rb', line 86 def default_regexp? regexp == DEFAULT_EXP end |
#symbol? ⇒ Boolean
90 |
# File 'lib/action_dispatch/journey/nodes/node.rb', line 90 def symbol?; true; end |