Go v0.4.0 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:

  • a tuple
  • 2 arguments (row, col)

Returns a tuple from Coordinate structure

Link to this section Types

Link to this section Functions

Link to this function from_tuple(coordinate) View Source
from_tuple({row(), col()}) :: t()

Returns a new Coordinate structure from a tuple

Link to this function list_from_tuples(coordinates) View Source
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
list_to_tuples([t()]) :: [{row(), col()}]

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

Link to this function new(coordinate) View Source
new({row(), col()}) :: t()

Returns a new Coordinate structure it accepts:

  • a tuple
  • 2 arguments (row, col)
Link to this function new(row, col) View Source
new(row(), col()) :: t()
Link to this function to_tuple(coordinate) View Source
to_tuple(t()) :: {row(), col()}

Returns a tuple from Coordinate structure