Skip to content
  • eileencodes's avatar
    437ab203
    Convert route params array into object · 437ab203
    eileencodes authored
    
    
    This PR converts the route params array into an object and moves the
    error generation code into its own object as well. This is a refactoring
    of internal code to make it easier to change and simplier for internals
    to interface with. We have two new objects:
    
    1) `RouteWithParams`
    
    Previously `#generate` returned an array of parameterized parts for a
    route. We have now turned this into an object with a `path` and a
    `params methods` to be able to access the parts we need.
    
    2) `MissingRoute`
    
    `#generate` was also responsible for constructing the message for the
    error. We've moved this code into the new `MissingRoute` object so it
    does that work instead.
    
    This change makes these methods reusable throughout the code and easier
    for future refactoring we plan to do.
    
    Co-authored-by: default avatarAaron Patterson <aaron.patterson@gmail.com>
    437ab203
    Convert route params array into object
    eileencodes authored
    
    
    This PR converts the route params array into an object and moves the
    error generation code into its own object as well. This is a refactoring
    of internal code to make it easier to change and simplier for internals
    to interface with. We have two new objects:
    
    1) `RouteWithParams`
    
    Previously `#generate` returned an array of parameterized parts for a
    route. We have now turned this into an object with a `path` and a
    `params methods` to be able to access the parts we need.
    
    2) `MissingRoute`
    
    `#generate` was also responsible for constructing the message for the
    error. We've moved this code into the new `MissingRoute` object so it
    does that work instead.
    
    This change makes these methods reusable throughout the code and easier
    for future refactoring we plan to do.
    
    Co-authored-by: default avatarAaron Patterson <aaron.patterson@gmail.com>
Loading