Gcode.Model.Tape (gcode v1.0.0)

The tape (%) denotes the beginning and end of the program and is not needed by most controllers. Can optionally contain a comment, called a "leader".

Link to this section Summary

Functions

Initialises a tape command, with no "leader"

Initialises a tape command, with a "leader"

Link to this section Types

@type error() :: {:tape_error, String.t()}
@type t() :: %Gcode.Model.Tape{leader: Gcode.Option.t(String.t())}

Link to this section Functions

@spec init() :: Gcode.Result.t(t())

Initialises a tape command, with no "leader"

example

Example

iex> Tape.init()
{:ok, %Tape{leader: :error}}
@spec init(String.t()) :: Gcode.Result.t(t(), error())

Initialises a tape command, with a "leader"

example

Example

iex> Tape.init("Marty in the Delorean with the Flux Capacitor")
{:ok, %Tape{leader: {:ok, "Marty in the Delorean with the Flux Capacitor"}}}