ExMarket v0.2.0 Exmarket View Source

Documentation for Exmarket.

Link to this section Summary

Functions

Takes a variable list of stock symbols and returns a map with the symbols and prices.

Takes the stock symbol (ticker) as input and returns the real-time value of the stock.

Returns the USD value of a crypto currency asset

Returns the current state of the GenServer. Previous calls to get_price(stock) are cached and returned as a map.

Resets the current state held in the GenServer back to an empty map ## Examples

Link to this section Functions

Takes a variable list of stock symbols and returns a map with the symbols and prices.

Examples

iex> Exmarket.batch_quote(["aapl", "tsla"]) %{"aapl" => 207.48, "tsla" => 263.9}

Takes the stock symbol (ticker) as input and returns the real-time value of the stock.

Examples

iex> Exmarket.get_price("aapl")
"204.53"

Returns the USD value of a crypto currency asset

Examples

iex> Exmarket.get_quote("btc") "5460.97"

Returns the current state of the GenServer. Previous calls to get_price(stock) are cached and returned as a map.

Examples

iex> Exmarket.get_state()
%{"aapl" => 207.48, "fb" => 183.78, "mfst" => 0.065, "tsla" => 263.9}

Resets the current state held in the GenServer back to an empty map ## Examples

iex> Exmarket.reset_state()
:ok