Go v0.4.3 Go.Coordinate View Source

Documentation for Go.Coordinate

To be more compliant with Ecto and JSON, this entity replace old tuple form of coordinate.

It is a simple struct with row and col keys.

Link to this section Summary

Functions

Returns a new Coordinate structure from a tuple

Returns a list of new Coordinate structures from a list of tuples

Returns a list of new tuples from a list of Coordinate structures

Returns a new Coordinate structure it accepts

Returns a tuple from Coordinate structure

Link to this section Types

Specs

col() :: integer()

Specs

row() :: integer()

Specs

t() :: %Go.Coordinate{col: col(), row: row()}

Link to this section Functions

Specs

from_tuple({row(), col()}) :: t()

Returns a new Coordinate structure from a tuple

Link to this function

list_from_tuples(coordinates)

View Source

Specs

list_from_tuples([{row(), col()}]) :: [t()]

Returns a list of new Coordinate structures from a list of tuples

Link to this function

list_to_tuples(coordinates)

View Source

Specs

list_to_tuples([t()]) :: [{row(), col()}]

Returns a list of new tuples from a list of Coordinate structures

Specs

new({row(), col()}) :: t()

Returns a new Coordinate structure it accepts:

  • a tuple
  • 2 arguments (row, col)

Specs

new(row(), col()) :: t()

Specs

to_tuple(t()) :: {row(), col()}

Returns a tuple from Coordinate structure