File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -52,13 +52,32 @@ defmodule Scenic.Cache do
52
52
53
53
# ===========================================================================
54
54
defmodule Error do
55
+ @ moduledoc """
56
+ Defines the exception thrown by the CacheModule
57
+ """
55
58
defexception message: nil
56
59
end
57
60
58
- # ============================================================================
59
61
# client apis
60
62
61
- # --------------------------------------------------------
63
+ @ doc """
64
+ This function to collects an item from the Cache.
65
+ This function accepts a key and a default both being any term in Elixir.
66
+
67
+ If there is no item in the Cache that corresponds to the key the function will return nil else the
68
+ function returns the term stored in the cache with the using the provided key
69
+
70
+ ## Examples
71
+
72
+ iex> Scenic.Cache.get("test_key")
73
+ nil
74
+
75
+ iex> :ets.insert(:scenic_cache_key_table, {"test_key", 1, :test_data})
76
+ ...> true
77
+ ...> Scenic.Cache.get("test_key")
78
+ :test_data
79
+ """
80
+ @ spec get ( term ( ) , term ( ) ) :: term ( ) | nil
62
81
def get ( key , default \\ nil )
63
82
64
83
def get ( key , default ) do
@@ -71,7 +90,6 @@ defmodule Scenic.Cache do
71
90
reraise ( other , __STACKTRACE__ )
72
91
end
73
92
74
- # --------------------------------------------------------
75
93
def fetch ( key )
76
94
77
95
def fetch ( key ) do
You can’t perform that action at this time.
0 commit comments