Class: Elmas::API

Inherits:
Object
  • Object
show all
Includes:
OAuth, Request
Defined in:
lib/elmas/api.rb

Direct Known Subclasses

Client

Instance Method Summary collapse

Methods included from OAuth

#authorize_division, #authorize_url, #authorized?, #get_access_token, #get_refresh_token

Methods included from Request

#delete, #get, #post, #put

Constructor Details

#initialize(options = {}) ⇒ API

Creates a new API



14
15
16
17
18
19
# File 'lib/elmas/api.rb', line 14

def initialize(options = {})
  options = Elmas.options.merge(options)
  Config::VALID_OPTIONS_KEYS.each do |key|
    send("#{key}=", options[key])
  end
end

Instance Method Details

#configObject



21
22
23
24
25
26
27
# File 'lib/elmas/api.rb', line 21

def config
  conf = {}
  Config::VALID_OPTIONS_KEYS.each do |key|
    conf[key] = send key
  end
  conf
end