Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
FileUtils.collect_method
(::Symbol opt) -> ::Array[::String]
collect_method(opt)
lib/fileutils.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/fileutils.rb, line 2641
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"]