Sheetshow.Op (Sheetshow v0.1.0)

Copy Markdown View Source

What a backend is asked to do.

A plan is a plain list of these, carried out in order. They say nothing about HTTP or about Google: Sheetshow.Memory interprets them in a map, and a backend encodes them as requests.

OpWhat it does
Sheetshow.Op.AddSheetadds a tab
Sheetshow.Op.DeleteSheetremoves one
Sheetshow.Op.PutCellswrites one run of cells along a row
Sheetshow.Op.AppendRowsadds rows below the last row with data
Sheetshow.Op.DeleteRowsremoves rows, the ones below moving up
Sheetshow.Op.SetDimensionssets column widths or row heights

Every op names the sheet it works on, so the cells inside one are placed by row and column alone and their coordinates carry no sheet of their own. The constructors take cells that do and strip them.

Summary

Functions

Every op struct, for guards and tests.

Whether the term is one of the ops.

The sheet an op works on.

Types

Functions

modules()

@spec modules() :: [module()]

Every op struct, for guards and tests.

op?(arg1)

@spec op?(term()) :: boolean()

Whether the term is one of the ops.

iex> Sheetshow.Op.op?(Sheetshow.Op.AddSheet.new("Costs"))
true
iex> Sheetshow.Op.op?(:add_sheet)
false

sheet(arg1)

@spec sheet(t()) :: String.t()

The sheet an op works on.

iex> Sheetshow.Op.sheet(Sheetshow.Op.AddSheet.new("Costs"))
"Costs"
iex> Sheetshow.Op.sheet(Sheetshow.Op.DeleteRows.new("log", 2..4))
"log"