Class: ActionController::Routing::PathSegment
- Inherits:
-
DynamicSegment
- Object
- Segment
- DynamicSegment
- ActionController::Routing::PathSegment
- Defined in:
- lib/action_controller/routing.rb
Overview
:nodoc:
Defined Under Namespace
Classes: Result
Constant Summary collapse
- EscapedSlash =
CGI.escape("/")
Instance Attribute Summary
Attributes inherited from DynamicSegment
Attributes inherited from Segment
Instance Method Summary collapse
- #default ⇒ Object
- #default=(path) ⇒ Object
- #interpolation_chunk ⇒ Object
- #match_extraction(next_capture) ⇒ Object
- #regexp_chunk ⇒ Object
Methods inherited from DynamicSegment
#build_pattern, #expiry_statement, #extract_value, #extraction_code, #initialize, #local_name, #optionality_implied?, #string_structure, #to_s, #value_check, #value_regexp
Methods inherited from Segment
#all_optionals_available_condition, #continue_string_structure, #extraction_code, #initialize, #interpolation_statement, #optionality_implied?, #string_structure
Constructor Details
This class inherits a constructor from ActionController::Routing::DynamicSegment
Instance Method Details
#default ⇒ Object
761 762 763 |
# File 'lib/action_controller/routing.rb', line 761 def default '' end |
#default=(path) ⇒ Object
765 766 767 |
# File 'lib/action_controller/routing.rb', line 765 def default=(path) raise RoutingError, "paths cannot have non-empty default values" unless path.blank? end |
#interpolation_chunk ⇒ Object
757 758 759 |
# File 'lib/action_controller/routing.rb', line 757 def interpolation_chunk "\#{CGI.escape(#{local_name}.to_s).gsub(#{EscapedSlash.inspect}, '/')}" end |
#match_extraction(next_capture) ⇒ Object
769 770 771 |
# File 'lib/action_controller/routing.rb', line 769 def match_extraction(next_capture) "params[:#{key}] = PathSegment::Result.new_escaped((match[#{next_capture}]#{" || " + default.inspect if default}).split('/'))#{" if match[" + next_capture + "]" if !default}" end |
#regexp_chunk ⇒ Object
773 774 775 |
# File 'lib/action_controller/routing.rb', line 773 def regexp_chunk regexp || "(.*)" end |