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

Inherits:
Unary
  • Object
show all
Defined in:
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

Constructor Details

#initialize(left) ⇒ Star

Returns a new instance of Star.



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

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.



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

def regexp
  @regexp
end

Instance Method Details

#nameObject



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

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

#star?Boolean

Returns:

  • (Boolean)


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

def star?; true; end

#typeObject



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

def type; :STAR; end