Class: SimpleRouter::Engines::SimpleEngine::Pattern
- Defined in:
- lib/simple_router/engines/simple_engine.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from Path
Instance Method Summary collapse
- #==(path) ⇒ Object
- #variables ⇒ Object (also: #vars)
Methods inherited from Path
Constructor Details
This class inherits a constructor from SimpleRouter::Engines::SimpleEngine::Path
Instance Method Details
#==(path) ⇒ Object
78 79 80 81 82 |
# File 'lib/simple_router/engines/simple_engine.rb', line 78 def ==(path) is_match = size_match?(path) && ext_match?(path) && static_match?(path) @match = path if is_match is_match end |
#variables ⇒ Object Also known as: vars
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/simple_router/engines/simple_engine.rb', line 66 def variables return [] unless @match a = [] self.parts.each_with_index do |part,i| a << @match.parts[i] if part[0] == ?: end a << @match.ext[1..-1] if self.ext[1] == ?: a end |