Cherry.Portfolio.Position (cherry v0.3.0)

Copy Markdown View Source

An employment position on the timeline; open ended means current.

Summary

Functions

True while the position has no end date.

Materialises the struct from a validated portfolio document.

Newest-first ordering: current positions rank above ended ones.

Types

t()

@type t() :: %Cherry.Portfolio.Position{
  cv: Cherry.Portfolio.Curation.t() | nil,
  ended: Date.t() | nil,
  highlights: [String.t()],
  html: String.t() | nil,
  location: String.t() | nil,
  org: String.t(),
  slug: String.t(),
  started: Date.t(),
  tags: [String.t()],
  title: String.t()
}

Functions

current?(position)

@spec current?(t()) :: boolean()

True while the position has no end date.

from_document(document)

@spec from_document(Cherry.Content.Document.t()) :: t()

Materialises the struct from a validated portfolio document.

sort_key(position)

@spec sort_key(t()) :: {:calendar.date(), :calendar.date()}

Newest-first ordering: current positions rank above ended ones.