The utf9k logo which is a cartoon robot utf9k

Elixir

How can I view methods associated with an object?

Let’s say we have the following module

defmodule Reminder do
  def alarm(time, day) do
  end
end

We can check what methods are on it by providing a :functions atom

Reminder.__info__(:functions)
# [alarm: 2]

As we can see, this Reminder module has an alarm method, with an arity of 2.

How can I view help documentation for a module

The iex interpreter includes a function called h which can be used to show documentation for a module

h String
# h/1

Did you like this post? Click here to let me know anonymously or see some proof of anonymity first.