Class: ActionDispatch::Journey::Nodes::Symbol
- Defined in:
- actionpack/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
- #type ⇒ Object
Methods inherited from Terminal
Methods inherited from Node
#cat?, #each, #group?, #literal?, #star?, #terminal?, #to_dot, #to_s, #to_sym
Methods included from Enumerable
#as_json, #compact_blank, #exclude?, #excluding, #including, #index_by, #index_with, #many?, #pluck, #sum, #without
Constructor Details
#initialize(left) ⇒ Symbol
Returns a new instance of Symbol.
82 83 84 85 86 |
# File 'actionpack/lib/action_dispatch/journey/nodes/node.rb', line 82 def initialize(left) super @regexp = DEFAULT_EXP @name = -left.tr("*:", "") end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name
79 80 81 |
# File 'actionpack/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 'actionpack/lib/action_dispatch/journey/nodes/node.rb', line 77 def regexp @regexp end |
Instance Method Details
#default_regexp? ⇒ Boolean
88 89 90 |
# File 'actionpack/lib/action_dispatch/journey/nodes/node.rb', line 88 def default_regexp? regexp == DEFAULT_EXP end |
#symbol? ⇒ Boolean
93 |
# File 'actionpack/lib/action_dispatch/journey/nodes/node.rb', line 93 def symbol?; true; end |
#type ⇒ Object
92 |
# File 'actionpack/lib/action_dispatch/journey/nodes/node.rb', line 92 def type; :SYMBOL; end |