Skip to content
  • schneems's avatar
    3c54b8e9
    Allow method chaining with Pathname#mkpath · 3c54b8e9
    schneems authored
    Currently in my code when I want to create a pathname object and create a path at the same time I must use tap
    
    ```
    path = Pathname.new("/tmp/new").tap(&:mkpath)
    ```
    
    I think it would be cleaner to be able to chain on the results of these methods instead:
    
    ```
    path = Pathname.new("/tmp/new").mkpath
    ```
    3c54b8e9
    Allow method chaining with Pathname#mkpath
    schneems authored
    Currently in my code when I want to create a pathname object and create a path at the same time I must use tap
    
    ```
    path = Pathname.new("/tmp/new").tap(&:mkpath)
    ```
    
    I think it would be cleaner to be able to chain on the results of these methods instead:
    
    ```
    path = Pathname.new("/tmp/new").mkpath
    ```
Loading