Current section

Files

Jump to
reactor_file lib reactor file step close_file.ex
Raw

lib/reactor/file/step/close_file.ex

defmodule Reactor.File.Step.CloseFile do
@moduledoc false
use Reactor.File.Step,
arg_schema: [
device: [
type: :any,
required: true,
doc: "The IO device to close"
]
],
opt_schema: [],
moduledoc: "A step which calls `File.close/1`"
@doc false
@impl true
def mutate(arguments, context, _options) do
with :ok <- close_file(arguments.device, context.current_step) do
{:ok, :ok}
end
end
end