Class: ActionDispatch::Journey::Format
Do not use. This class is for internal use only.
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Inherits: | Object |
Defined in: | actionpack/lib/action_dispatch/journey/visitors.rb |
Constant Summary
-
ESCAPE_PATH =
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 9->(value) { Router::Utils.escape_path(value) }
-
ESCAPE_SEGMENT =
# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 10->(value) { Router::Utils.escape_segment(value) }
Class Method Summary
Instance Method Summary
Constructor Details
.new(parts) ⇒ Format
Class Method Details
.required_path(symbol)
[ GitHub ]# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 16
def self.required_path(symbol) Parameter.new symbol, ESCAPE_PATH end
.required_segment(symbol)
[ GitHub ]# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 20
def self.required_segment(symbol) Parameter.new symbol, ESCAPE_SEGMENT end
Instance Method Details
#evaluate(hash)
[ GitHub ]# File 'actionpack/lib/action_dispatch/journey/visitors.rb', line 39
def evaluate(hash) parts = @parts.dup @parameters.each do |index| param = parts[index] value = hash[param.name] return "" if value.nil? parts[index] = param.escape value end @children.each { |index| parts[index] = parts[index].evaluate(hash) } parts.join end