123456789_123456789_123456789_123456789_123456789_

Class: RuboCop::TargetRuby Private

Do not use. This class is for internal use only.
Relationships & Source Files
Namespace Children
Classes:
Inherits: Object
Defined in: lib/rubocop/target_ruby.rb

Overview

The kind of Ruby that code inspected by RuboCop is written in.

Constant Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Class Method Details

.supported_versions

[ GitHub ]

  
# File 'lib/rubocop/target_ruby.rb', line 244

def self.supported_versions
  KNOWN_RUBIES
end

Instance Attribute Details

#supported?Boolean (readonly)

[ GitHub ]

  
# File 'lib/rubocop/target_ruby.rb', line 270

def supported?
  KNOWN_RUBIES.include?(version)
end

Instance Method Details

#rubocop_version_with_support

[ GitHub ]

  
# File 'lib/rubocop/target_ruby.rb', line 274

def rubocop_version_with_support
  if supported?
    RuboCop::Version::STRING
  else
    OBSOLETE_RUBIES[version]
  end
end

#source

[ GitHub ]

  
# File 'lib/rubocop/target_ruby.rb', line 262

def source
  @source ||= SOURCES.each.lazy.map { |c| c.new(@config) }.detect(&:version)
end

#version

[ GitHub ]

  
# File 'lib/rubocop/target_ruby.rb', line 266

def version
  source.version
end