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
763 764 765 |
# File 'lib/action_controller/routing.rb', line 763 def default '' end |
#default=(path) ⇒ Object
767 768 769 |
# File 'lib/action_controller/routing.rb', line 767 def default=(path) raise RoutingError, "paths cannot have non-empty default values" unless path.blank? end |
#interpolation_chunk ⇒ Object
759 760 761 |
# File 'lib/action_controller/routing.rb', line 759 def interpolation_chunk "\#{CGI.escape(#{local_name}.to_s).gsub(#{EscapedSlash.inspect}, '/')}" end |
#match_extraction(next_capture) ⇒ Object
771 772 773 |
# File 'lib/action_controller/routing.rb', line 771 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
775 776 777 |
# File 'lib/action_controller/routing.rb', line 775 def regexp_chunk regexp || "(.*)" end |