Class: Walle::Robot::Router::Route::Prefix
- Inherits:
-
Mutator
- Object
- Mutator
- Walle::Robot::Router::Route::Prefix
show all
- Defined in:
- lib/walle/robot/router/route.rb
Instance Attribute Summary
Attributes inherited from Mutator
#env, #options, #regexp
Instance Method Summary
collapse
Methods inherited from Mutator
#initialize
Instance Method Details
#mutate ⇒ Object
19
20
21
22
23
24
25
26
27
|
# File 'lib/walle/robot/router/route.rb', line 19
def mutate
return regexp unless prefix
if regexp
Regexp.new("#{prefix}#{regexp.source}")
else
Regexp.new(prefix)
end
end
|
#prefix ⇒ Object
29
30
31
32
|
# File 'lib/walle/robot/router/route.rb', line 29
def prefix
return if options[:prefix] === false
options[:prefix] || '.*'
end
|