Back in our browser we see that our module plug is working - our movie total is being loaded.

Now let’s go back to our module plug, and in the init function we’re just returning any options that are passed in. We’re then ignoring them in the call function. Let’s change that.

Let’s pass in a message as an option that we’ll render along with our movie total.

The options passed into our init function are a keyword list, so let’s use Keyword.fetch/2 to return our message.

Now we could use Keyword.fetch!/2, which will return our message or raise an exception, whereas the Keyword.fetch/2 function, will return an :ok tuple with our message or :error if they key doesn’t exist.

Let’s use this (and have some fun) using pattern matching to match against our two cases.