View Source Qrusty.QR (qrusty v0.1.3)

QR struct for:

  • validating input
  • catalogging input
  • generating an encoded QR

Link to this section Summary

Functions

Validates input arguements and generates a QR if valid.

Link to this section Types

@type t() :: %Qrusty.QR{
  data: binary(),
  encoded_data: binary() | String.t(),
  format: atom(),
  height: integer(),
  width: integer()
}

Link to this section Functions

Link to this function

new(data, format, width, height)

View Source
@spec new(data :: binary(), format :: atom(), width :: integer(), [
  {:height, integer()}
]) ::
  {:ok,
   %Qrusty.QR{
     data: term(),
     encoded_data: term(),
     format: term(),
     height: term(),
     width: term()
   }}
  | {:error, :invalid_dimensions}
  | {:error, :invalid_format}
  | {:error, :invalid_data}

Validates input arguements and generates a QR if valid.