Peek (peek v0.2.0) View Source

Peek at typespecs in a module and get them in a more-usable format.

Link to this section Summary

Functions

Peek at a type in a module.

Link to this section Functions

Link to this function

peek(module, opts \\ [])

View Source

Specs

peek(atom(), Keyword.t()) :: map()

Peek at a type in a module.

Usage

# Defaults to `:t`
Peek.peek MyApp.Module

# Check a specific type
Peek.peek MyApp.Module, type: :my_type

# Filter out the `:__struct__` key for cleaner output
Peek.peek MyApp.Module, filter_structs: true

Options

  • type: The type to get info for. Defaults to :t.
  • filter_structs: Whether or not to filter out the :__struct__ key. Defaults to false.
  • all_types: Whether or not to return a map of all types. Defaults to false.