Skip to content

Instantly share code, notes, and snippets.

@adkron
Created Sep 13, 2017
Embed
What would you like to do?
defmodule Zipato.Sessions.Hub.Impl do
alias Zipato.Sessions.Behaviour
use Behaviour
@moduledoc """
Implementation for hub session
See `Zipato.Sessions.Hub` for more information.
"""
alias Zipato.Commands.{Authentication}
@doc """
Connects a hub session
"""
@impl Behaviour
def connect(%{serial: serial} = state, config) do
{:ok, session_id} = Authentication.connect_box_session(serial, config.credentials, config.api)
%{state | id: session_id}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment