Flowdock
method

string_structure

Importance_0
v2.1.0 - Show latest stable - 0 notes - Class: ActionController::Routing::DynamicSegment
string_structure(prior_segments) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_controller/routing/segments.rb, line 159
      def string_structure(prior_segments)
        if optional? # We have a conditional to do...
          # If we should not appear in the url, just write the code for the prior
          # segments. This occurs if our value is the default value, or, if we are
          # optional, if we have nil as our value.
          "if #{local_name} == #{default.inspect}\n" +
            continue_string_structure(prior_segments) +
          "\nelse\n" + # Otherwise, write the code up to here
            "#{interpolation_statement(prior_segments)}\nend"
        else
          interpolation_statement(prior_segments)
        end
      end
Register or log in to add new notes.