Module: RubyVersionCheck
- Defined in:
- lib/ruby_version_check.rb
Class Method Summary collapse
-
.ruby_version2? ⇒ Boolean
Allows maintaining version compatibility with older versions of Ruby :nocov:.
- .ruby_version3? ⇒ Boolean
Class Method Details
.ruby_version2? ⇒ Boolean
Allows maintaining version compatibility with older versions of Ruby :nocov:
6 7 8 9 10 11 |
# File 'lib/ruby_version_check.rb', line 6 def self.ruby_version2? @ruby_version2 ||= ( Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.0.0") && Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.0.0") ) end |
.ruby_version3? ⇒ Boolean
13 14 15 |
# File 'lib/ruby_version_check.rb', line 13 def self.ruby_version3? @ruby_version3 ||= (Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.0.0")) end |