Method: Felis::API#initialize
- Defined in:
- lib/felis/api.rb
#initialize(options = {}) ⇒ API
Returns a new instance of API.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/felis/api.rb', line 9 def initialize( = {}) @base_uri = .fetch(:base_uri, "https://api.e2ma.net") @account_id = .fetch(:account_id, ENV['EMMA_ACCOUNT_ID'] || nil) @private_key = .fetch(:private_key, ENV['EMMA_PRIVATE_KEY'] || nil) @public_key = .fetch(:public_key, ENV['EMMA_PUBLIC_KEY'] || nil) @debug = .fetch(:debug, false) @timeout = .fetch(:timeout, 30) @defaults = { basic_auth: { username: @public_key, password: @private_key } } setup_base_uri end |