Class: Enigma::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/enigma/client.rb

Overview

Connects to the Enigma api at app.enigma.io/api.

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Client

Creates a new client connection

The api key Defaults to the ENIGMA_KEY environment variable

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • key (String)
    • Enigma API key.



13
14
15
16
# File 'lib/enigma/client.rb', line 13

def initialize(opts = {})
  Enigma.key = ENV['ENIGMA_KEY'] || opts[:key]
  fail ArgumentError, 'API key is required' unless Enigma.key
end