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