2 lines is enough here:
```ruby
erb_path = @pattern_spec['path_format']
path = ERB.new(erb_path).result(binding())
```