exNoops v0.1.1 Exnoops.Sortbot View Source

Module to interact with Github's Noop: Sortbot

See the official noop documentation for API information including the accepted parameters.

Link to this section Summary

Functions

Submit responses to Sortbot

Query Sortbot for welcome

Link to this section Functions

Link to this function

submit(path, body) View Source
submit(String.t(), keyword()) :: {atom(), map()}

Submit responses to Sortbot

Examples

iex> Exnoops.Sortbot.submit("/sortbot/exam/start", login: "test")
{:ok, %{
  "message" => "Hello test, get ready for all sorts of fun. Get it?",
  "nextSet" => "/sortbot/exam/3qm7iTRNtpn8NIUqtBubvQ"
}}

iex> Exnoops.Sortbot.submit("/sortbot/exam/3qm7iTRNtpn8NIUqtBubvQ", solution: [32, 35, 40, 46, 52, 53, 73, 80, 95, 96])
{:ok, %{
  "result" => "success",
  "message" => "Great job!",
  "elapsed" => 0,
  "nextSet" => "/sortbot/exam/6YXxoDcJDtzp8Aj3iY0W0A"
}}

Query Sortbot for welcome

Examples

iex> Exnoops.Sortbot.welcome()
{:ok, "Hello there, welcome to the Sortbot. Get started at /sortbot/exam"}