Class: ActionDispatch::Journey::Nodes::Star
- Defined in:
- lib/action_dispatch/journey/nodes/node.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#regexp ⇒ Object
Returns the value of attribute regexp.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(left) ⇒ Star
constructor
A new instance of Star.
- #name ⇒ Object
- #star? ⇒ Boolean
- #type ⇒ Object
Methods inherited from Unary
Methods inherited from Node
#cat?, #each, #group?, #literal?, #symbol?, #terminal?, #to_dot, #to_s, #to_sym
Constructor Details
#initialize(left) ⇒ Star
Returns a new instance of Star.
167 168 169 170 171 172 |
# File 'lib/action_dispatch/journey/nodes/node.rb', line 167 def initialize(left) super(left) # By default wildcard routes are non-greedy and must match something. @regexp = /.+?/m end |
Instance Attribute Details
#regexp ⇒ Object
Returns the value of attribute regexp.
165 166 167 |
# File 'lib/action_dispatch/journey/nodes/node.rb', line 165 def regexp @regexp end |
Instance Method Details
#name ⇒ Object
177 178 179 |
# File 'lib/action_dispatch/journey/nodes/node.rb', line 177 def name left.name.tr "*:", "" end |
#star? ⇒ Boolean
174 |
# File 'lib/action_dispatch/journey/nodes/node.rb', line 174 def star?; true; end |
#type ⇒ Object
175 |
# File 'lib/action_dispatch/journey/nodes/node.rb', line 175 def type; :STAR; end |