Class: WrAPI::API

Inherits:
Object
  • Object
show all
Includes:
Authentication, Connection, Request
Defined in:
lib/wrapi/api.rb

Constant Summary

Constants included from Request

Request::CONTENT_TYPE_HDR

Instance Method Summary collapse

Methods included from Authentication

#api_auth, #api_refresh

Methods included from Request

#delete, #get, #get_paged, #is_json?, #post, #put

Constructor Details

#initialize(options = {}) ⇒ API

Creates a new API and copies settings from singleton



13
14
15
16
17
18
# File 'lib/wrapi/api.rb', line 13

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

Instance Method Details

#configObject



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

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