Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
FileUtils.collect_method
collect_method(opt)
lib/fileutils.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/fileutils.rb, line 2609
def self.collect_method(opt)
OPT_TABLE.keys.select {|m| OPT_TABLE[m].include?(opt) }
end
Returns an array of the string method names of the methods that accept the given keyword option opt; the argument must be a symbol:
Example
FileUtils.collect_method(:preserve) # => ["cp", "copy", "cp_r", "install"]