List Methods



examples/other/methods.cr
class Object
  macro methods
        {{ @type.methods.map &.name.stringify }}
    end
end

p! Bool.methods
p! String.methods
p! Int32.methods
p! Array.methods
p! Hash.methods

Bool.methods # => ["|", "&", "^", "hash", "to_unsafe", "to_s", "to_s", "clone", "==", "!="]
String.methods # => ["bytesize", "to_i", "to_i", "to_i?", "to_i8", "to_i8", "to_i8?", "to_u8", "to_u8", "to_u8?", "to_i16", "to_i16", "to_i16?", "to_u16", "to_u16", "to_u16?", "to_i32", "to_i32", "to_i32?", "to_u32", "to_u32", "to_u32?", "to_i64", "to_i64", "to_i64?", "to_u64", "to_u64", "to_u64?", "to_u64_info", "to_f", "to_f64", "to_f?", "to_f64?", "to_f32", "to_f32?", "to_f_impl", "[]", "[]", "[]", "[]", "[]", "[]", "[]?", "[]?", "[]?", "[]?", "[]?", "[]?", "char_at", "char_at", "delete_at", "delete_at", "delete_at", "byte_delete_at", "unicode_delete_at", "find_start_end_and_index", "byte_slice", "byte_slice", "byte_slice?", "codepoint_at", "byte_at", "byte_at", "byte_at?", "unsafe_byte_at", "downcase", "downcase", "upcase", "upcase", "capitalize", "capitalize", "titleize", "titleize", "chomp", "chomp", "chomp", "lchop", "lchop", "lchop?", "lchop?", "rchop", "rchop", "rchop?", "rchop?", "encode", "hexbytes", "hexbytes?", "insert", "insert", "insert_impl", "strip", "strip", "strip", "strip", "rstrip", "rstrip", "rstrip", "rstrip", "lstrip", "lstrip", "lstrip", "lstrip", "calc_excess_right", "calc_excess_right", "calc_excess_right", "calc_excess_right", "calc_excess_left", "calc_excess_left", "calc_excess_left", "calc_excess_left", "remove_excess", "remove_excess_right", "remove_excess_left", "tr", "sub", "sub", "sub", "sub", "sub", "sub", "sub", "sub", "sub", "sub", "sub", "sub", "sub_append", "sub_index", "sub_range", "has_back_references?", "scan_backreferences", "gsub", "gsub", "gsub", "gsub", "gsub", "gsub", "gsub", "gsub", "gsub", "gsub_ascii_char", "gsub_append", "count", "count", "count", "delete", "delete", "delete", "squeeze", "squeeze", "squeeze", "squeeze", "empty?", "blank?", "presence", "==", "<=>", "compare", "=~", "=~", "+", "+", "*", "index", "index", "index", "rindex", "rindex", "rindex", "partition", "partition", "rpartition", "rpartition", "byte_index", "byte_index", "char_index_to_byte_index", "byte_index_to_char_index", "includes?", "split", "split", "split", "split", "split", "split", "split", "split", "split_single_byte", "split_by_empty_separator", "lines", "each_line", "each_line", "underscore", "underscore", "camelcase", "camelcase", "reverse", "ljust", "ljust", "rjust", "rjust", "center", "center", "just", "succ", "match", "matches?", "scan", "scan", "scan", "scan", "each_char", "each_char", "each_char_with_index", "chars", "each_codepoint", "each_codepoint", "codepoints", "each_byte", "each_byte", "bytes", "pretty_print", "inspect", "inspect", "inspect_unquoted", "inspect_unquoted", "dump", "dump", "dump_unquoted", "dump_unquoted", "dump_or_inspect", "dump_or_inspect_unquoted", "inspect_char", "dump_char", "dump_or_inspect_char", "dump_hex", "dump_unicode", "starts_with?", "starts_with?", "starts_with?", "ends_with?", "ends_with?", "ends_with?", "%", "hash", "size", "ascii_only?", "single_byte_optimizable?", "valid_encoding?", "scrub", "char_bytesize_at", "size_known?", "each_byte_index_and_char_index", "clone", "dup", "to_s", "to_s", "to_slice", "to_unsafe", "unsafe_byte_slice", "unsafe_byte_slice", "unsafe_byte_slice_string", "unsafe_byte_slice_string", "check_no_null_byte", "to_utf16"]
Int32.methods # => ["/", "/", "/", "/", "/", "/", "/", "/", "/", "/", "/", "/", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "popcount", "leading_zeros_count", "trailing_zeros_count", "clone", "to_i", "to_i!", "to_u", "to_u!", "to_f", "to_f!", "to_i8", "to_i8!", "to_i16", "to_i16!", "to_i32", "to_i32!", "to_i64", "to_i64!", "to_i128", "to_i128!", "to_u8", "to_u8!", "to_u16", "to_u16!", "to_u32", "to_u32!", "to_u64", "to_u64!", "to_u128", "to_u128!", "to_f32", "to_f32!", "to_f64", "to_f64!", "==", "==", "==", "==", "==", "==", "==", "==", "==", "==", "==", "==", "!=", "!=", "!=", "!=", "!=", "!=", "!=", "!=", "!=", "!=", "!=", "!=", "<", "<", "<", "<", "<", "<", "<", "<", "<", "<", "<", "<", "<=", "<=", "<=", "<=", "<=", "<=", "<=", "<=", "<=", "<=", "<=", "<=", ">", ">", ">", ">", ">", ">", ">", ">", ">", ">", ">", ">", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", "unsafe_chr", "+", "+", "+", "+", "+", "+", "+", "+", "+", "+", "+", "+", "&+", "&+", "&+", "&+", "&+", "&+", "&+", "&+", "&+", "&+", "&-", "&-", "&-", "&-", "&-", "&-", "&-", "&-", "&-", "&-", "*", "*", "*", "*", "*", "*", "*", "*", "*", "*", "*", "*", "&*", "&*", "&*", "&*", "&*", "&*", "&*", "&*", "&*", "&*", "|", "|", "|", "|", "|", "|", "|", "|", "|", "|", "&", "&", "&", "&", "&", "&", "&", "&", "&", "&", "^", "^", "^", "^", "^", "^", "^", "^", "^", "^", "unsafe_shl", "unsafe_shl", "unsafe_shl", "unsafe_shl", "unsafe_shl", "unsafe_shl", "unsafe_shl", "unsafe_shl", "unsafe_shl", "unsafe_shl", "unsafe_shr", "unsafe_shr", "unsafe_shr", "unsafe_shr", "unsafe_shr", "unsafe_shr", "unsafe_shr", "unsafe_shr", "unsafe_shr", "unsafe_shr", "unsafe_div", "unsafe_div", "unsafe_div", "unsafe_div", "unsafe_div", "unsafe_div", "unsafe_div", "unsafe_div", "unsafe_div", "unsafe_div", "unsafe_mod", "unsafe_mod", "unsafe_mod", "unsafe_mod", "unsafe_mod", "unsafe_mod", "unsafe_mod", "unsafe_mod", "unsafe_mod", "unsafe_mod"]
Array.methods # => ["initialize", "initialize", "initialize", "size", "==", "==", "<=>", "&", "|", "+", "-", "*", "<<", "[]=", "[]=", "[]=", "[]=", "[]=", "[]", "[]", "[]?", "[]?", "unsafe_fetch", "clear", "clone", "compact", "compact!", "concat", "concat", "delete", "delete_at", "delete_at", "delete_at", "dup", "fill", "fill", "fill", "fill", "fill", "fill", "fill", "fill", "first", "insert", "inspect", "last", "size=", "map", "map!", "select!", "select!", "reject!", "reject!", "internal_delete", "map_with_index", "map_with_index!", "skip", "flatten", "repeated_permutations", "each_repeated_permutation", "pop", "pop", "pop", "pop?", "product", "product", "push", "push", "replace", "reverse", "reverse!", "rotate!", "rotate", "shift", "shift", "shift", "shift_when_not_empty", "shift?", "shuffle", "shuffle!", "sort", "sort", "sort!", "sort!", "sort_by", "sort_by!", "swap", "to_a", "to_s", "pretty_print", "to_unsafe", "transpose", "uniq", "uniq", "uniq!", "uniq!", "unshift", "unshift", "update", "check_needs_resize", "needs_resize?", "remaining_capacity", "double_capacity", "resize_to_capacity", "double_capacity_for_unshift", "resize_to_capacity_for_unshift", "resize_if_cant_insert", "root_buffer", "shift_buffer_by", "reset_buffer_to_root_buffer", "to_lookup_hash", "to_lookup_hash", "index"]
Hash.methods # => ["initialize", "initialize", "upsert", "update_linear_scan", "delete_impl", "delete_linear_scan", "find_entry", "find_entry_linear_scan", "resize", "do_compaction", "double_indices_size", "clear_impl", "initialize_dup", "initialize_clone", "initialize_compare_by_identity", "initialize_dup_entries", "initialize_clone_entries", "initialize_copy_non_entries_vars", "get_index", "set_index", "indices_size", "compute_indices_bytesize", "malloc_indices", "indices_malloc_size", "realloc_indices", "clear_indices", "get_entry", "set_entry", "add_entry_and_increment_size", "delete_entry", "delete_entry_and_update_counts", "entries_full?", "each_entry_with_index", "malloc_entries", "realloc_entries", "clear_entries", "next_index", "fit_in_indices", "first_entry?", "last_entry?", "entries", "entries_size", "entries_capacity", "key_hash", "entry_matches?", "entry_matches?", "size", "compare_by_identity", "compare_by_identity?", "[]=", "put", "[]", "[]?", "dig?", "dig?", "dig", "dig", "has_key?", "has_value?", "fetch", "fetch", "values_at", "key_for", "key_for", "key_for?", "delete", "delete", "empty?", "each", "each", "each_key", "each_key", "each_value", "each_value", "keys", "values", "merge", "merge", "merge!", "merge!", "select", "select", "select", "select!", "select!", "select!", "reject", "reject", "reject!", "reject!", "reject!", "compact", "compact!", "transform_keys", "transform_values", "transform_values!", "first_key", "first_key?", "first_value", "first_value?", "last_key", "last_key?", "last_value", "last_value?", "shift", "shift", "shift?", "clear", "==", "hash", "dup", "clone", "inspect", "to_s", "pretty_print", "to_a", "to_a_impl", "to_h", "rehash", "invert"]