class Prism::CurrentVersionError - Documentation for Ruby 4.0
Description: class Prism::CurrentVersionError: Raised when requested to parse as the currently running Ruby version but Prism has no support for it.
Keywords: ruby,class,Prism::CurrentVersionError

🔍

No recent searches

# class Prism::CurrentVersionError

Raised when requested to parse as the currently running Ruby version but `Prism` has no support for it.

### Public Class Methods

new (version)
Source

    # File lib/prism.rb, line 43
    def initialize(version)
      message = +"invalid version: Requested to parse as `version: 'current'`; "
      segments =
        if version.match?(/\A\d+\.\d+.\d+\z/)
          version.split(".").map(&:to_i)
        end

      if segments && ((segments[0] < 3) || (segments[0] == 3 && segments[1] < 3))
        message << " #{version} is below the minimum supported syntax."
      else
        message << " #{version} is unknown. Please update the `prism` gem."
      end

      super(message)
    end

Initialize a new exception for the given ruby version string.

Calls superclass method `Exception::new`