infuse v0.1.4 Infuse.Simplates.Registry

A simple GenServer to keep track of Simplates

Summary

Functions

Delete the entry corresponding to a key from the store

Return the value associated with key, or nil is there is none.

iex> Infuse.Simplates.Registry.start_link
iex> Infuse.Simplates.Registry.put "index.spt", %Page{}
iex> Infuse.Simplates.Registry.get "index.spt"
%Page{}
iex> Infuse.Simplates.Registry.stop
:ok

Add a simplate to the registry

iex> Infuse.Simplates.Registry.start_link
iex> Infuse.Simplates.Registry.put "index.spt", %Page{}
iex> Infuse.Simplates.Registry.get "index.spt"
%Page{}
iex> Infuse.Simplates.Registry.stop
:ok

Creates a key => value store for simplates.

iex> Infuse.Simplates.Registry.start_link
iex> Infuse.Simplates.Registry.stop
:ok

Stop the simplate server

Functions

delete(key)

Delete the entry corresponding to a key from the store

iex> Infuse.Simplates.Registry.start_link
iex> Infuse.Simplates.Registry.put "index.spt", %Page{}
iex> Infuse.Simplates.Registry.get "index.spt"
%Page{}
iex> Infuse.Simplates.Registry.delete "index.spt"
iex> Infuse.Simplates.Registry.get "index.spt"
nil
iex> Infuse.Simplates.Registry.stop
:ok
get(key)

Return the value associated with key, or nil is there is none.

iex> Infuse.Simplates.Registry.start_link
iex> Infuse.Simplates.Registry.put "index.spt", %Page{}
iex> Infuse.Simplates.Registry.get "index.spt"
%Page{}
iex> Infuse.Simplates.Registry.stop
:ok
put(key, value)

Add a simplate to the registry

iex> Infuse.Simplates.Registry.start_link
iex> Infuse.Simplates.Registry.put "index.spt", %Page{}
iex> Infuse.Simplates.Registry.get "index.spt"
%Page{}
iex> Infuse.Simplates.Registry.stop
:ok
start_link()

Creates a key => value store for simplates.

iex> Infuse.Simplates.Registry.start_link
iex> Infuse.Simplates.Registry.stop
:ok
stop()

Stop the simplate server