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, #compact_blank, #exclude?, #excluding, #in_order_of, #including, #index_by, #index_with, #many?, #maximum, #minimum, #pick, #pluck, #sole, #sum

Constructor Details

#initialize(left) ⇒ Star

Returns a new instance of Star.


109
110
111
112
113
114
# File 'actionpack/lib/action_dispatch/journey/nodes/node.rb', line 109

def initialize(left)
  super(left)

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

Instance Attribute Details

#regexpObject

Returns the value of attribute regexp


107
108
109
# File 'actionpack/lib/action_dispatch/journey/nodes/node.rb', line 107

def regexp
  @regexp
end

Instance Method Details

#nameObject


119
120
121
# File 'actionpack/lib/action_dispatch/journey/nodes/node.rb', line 119

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

#star?Boolean

Returns:

  • (Boolean)

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

def star?; true; end

#typeObject


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

def type; :STAR; end