Module: RuboCop::Cop::TargetRubyVersion

Overview

Common functionality for checking target ruby version.

Instance Method Summary collapse

Instance Method Details

#minimum_target_ruby_version(version) ⇒ Object



11
12
13
# File 'lib/rubocop/cop/mixin/target_ruby_version.rb', line 11

def minimum_target_ruby_version(version)
  @minimum_target_ruby_version = version
end

#required_minimum_ruby_versionObject



7
8
9
# File 'lib/rubocop/cop/mixin/target_ruby_version.rb', line 7

def required_minimum_ruby_version
  @minimum_target_ruby_version
end

#support_target_ruby_version?(version) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/rubocop/cop/mixin/target_ruby_version.rb', line 15

def support_target_ruby_version?(version)
  required_minimum_ruby_version <= version
end