diff --git a/lib/wx/core/file_dialog.rb b/lib/wx/core/file_dialog.rb index af7fddf1..8117ce87 100644 --- a/lib/wx/core/file_dialog.rb +++ b/lib/wx/core/file_dialog.rb @@ -23,9 +23,16 @@ class FileDialog class FileDialogCustomizeHook # prevent construction of abstract base - def self.new(*, **) - raise NotImplementedError, 'Wx::FileDialogCustomizeHook is an abstract class.' if self == Wx::FileDialogCustomizeHook - super + if RUBY_VERSION < '2.7.0' + def self.new(*) + raise NotImplementedError, 'Wx::FileDialogCustomizeHook is an abstract class.' if self == Wx::FileDialogCustomizeHook + super + end + else + def self.new(*, **) + raise NotImplementedError, 'Wx::FileDialogCustomizeHook is an abstract class.' if self == Wx::FileDialogCustomizeHook + super + end end # provide default no-ops