Class: ActionDispatch::Journey::Router::Strexp

Inherits:
Object
  • Object
show all
Defined in:
lib/action_dispatch/journey/router/strexp.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, requirements, separators, anchor = true) ⇒ Strexp

Returns a new instance of Strexp.



11
12
13
14
15
16
# File 'lib/action_dispatch/journey/router/strexp.rb', line 11

def initialize(path, requirements, separators, anchor = true)
  @path         = path
  @requirements = requirements
  @separators   = separators
  @anchor       = anchor
end

Instance Attribute Details

#anchorObject (readonly)

Returns the value of attribute anchor.



9
10
11
# File 'lib/action_dispatch/journey/router/strexp.rb', line 9

def anchor
  @anchor
end

#pathObject (readonly)

Returns the value of attribute path.



9
10
11
# File 'lib/action_dispatch/journey/router/strexp.rb', line 9

def path
  @path
end

#requirementsObject (readonly)

Returns the value of attribute requirements.



9
10
11
# File 'lib/action_dispatch/journey/router/strexp.rb', line 9

def requirements
  @requirements
end

#separatorsObject (readonly)

Returns the value of attribute separators.



9
10
11
# File 'lib/action_dispatch/journey/router/strexp.rb', line 9

def separators
  @separators
end

Instance Method Details

#namesObject



18
19
20
# File 'lib/action_dispatch/journey/router/strexp.rb', line 18

def names
  @path.scan(/:\w+/).map { |s| s.tr(':', '') }
end