Erl2ex v0.0.9 Erl2ex.Sink

Erl2ex.Sink is a process that consumes generated Elixir source, normally writing files to the file system.

Summary

Types

t()

The ProcessID of a sink process

Functions

Gets the file contents written to the given ID

Returns whether the given file identifier has been written to

Starts a sink and returns its PID

Stops the sink process

Writes data to a sink, at the given path

Types

t :: pid

The ProcessID of a sink process.

Functions

get_string(sink, path)

Specs

get_string(t, Erl2ex.file_id) ::
  {:ok, String.t} |
  {:error, term}

Gets the file contents written to the given ID.

Available only if the allow_get configuration is in effect.

path_written?(sink, path)

Specs

path_written?(t, Erl2ex.file_id) :: boolean

Returns whether the given file identifier has been written to.

start_link(opts \\ [])

Specs

start_link(list) :: t

Starts a sink and returns its PID.

stop(sink)

Specs

stop(t) :: :ok

Stops the sink process.

write(sink, path, str)

Specs

write(t, Erl2ex.file_id, String.t) ::
  :ok |
  {:error, term}

Writes data to a sink, at the given path.