diff --git a/lib/console/filter.rb b/lib/console/filter.rb index 18218f0..863bf8e 100644 --- a/lib/console/filter.rb +++ b/lib/console/filter.rb @@ -12,7 +12,7 @@ module Console UNKNOWN = 'unknown' class Filter - if Object.const_defined?(:Ractor) + if Object.const_defined?(:Ractor) and RUBY_VERSION >= '3.1' def self.define_immutable_method(name, &block) block = Ractor.make_shareable(block) self.define_method(name, &block)