Ruby Methods List How to Get

Getting a List of Methods in Ruby

This article introduces how to get a list of methods for a specific object or module in Ruby.

Shou Arisaka
1 min read
Nov 9, 2025

Getting a List of Methods in Ruby

To get a list of methods that a specific object or module has in Ruby, do it as follows:

# Load necessary library
require 'csv'

# Get list of CSV module methods (excluding inherited methods)
p CSV.methods(false)
#=> [:read, :open, :readlines, :foreach, :parse, :table, :instance, :filter, :generate, :generate_line, :parse_line]

# Get list of YAML module methods (excluding inherited methods)
p YAML.methods(false)
#=> [:load, :dump, :add_domain_type, :add_builtin_type, :tag_class, :tagurize, :object_maker, :quick_emit, :add_ruby_type, :read_type_class, :transfer]

This allows you to check what methods the specified object or module has.

Share this article

Shou Arisaka Nov 9, 2025

๐Ÿ”— Copy Links