Class: ActionDispatch::Journey::Nodes::Star

Inherits:
Unary show all
Defined in:
actionpack/lib/action_dispatch/journey/nodes/node.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Attributes inherited from Node

#left, #memo

Instance Method Summary collapse

Methods inherited from Unary

#children

Methods inherited from Node

#cat?, #each, #group?, #literal?, #symbol?, #terminal?, #to_dot, #to_s, #to_sym

Methods included from Enumerable

#as_json

Constructor Details

#initialize(left) ⇒ Star

Returns a new instance of Star.



165
166
167
168
169
170
# File 'actionpack/lib/action_dispatch/journey/nodes/node.rb', line 165

def initialize(left)
  super(left)

  # By default wildcard routes are non-greedy and must match something.
  @regexp = /.+?/m
end

Instance Attribute Details

#regexpObject

Returns the value of attribute regexp



163
164
165
# File 'actionpack/lib/action_dispatch/journey/nodes/node.rb', line 163

def regexp
  @regexp
end

Instance Method Details

#nameObject



175
176
177
# File 'actionpack/lib/action_dispatch/journey/nodes/node.rb', line 175

def name
  left.name.tr "*:", ""
end

#star?Boolean

Returns:

  • (Boolean)


172
# File 'actionpack/lib/action_dispatch/journey/nodes/node.rb', line 172

def star?; true; end

#typeObject



173
# File 'actionpack/lib/action_dispatch/journey/nodes/node.rb', line 173

def type; :STAR; end