Class: Hudu::API

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

Direct Known Subclasses

Client

Constant Summary

Constants included from Configuration

Configuration::DEFAULT_PAGE_SIZE, Configuration::DEFAULT_PAGINATION, Configuration::DEFAULT_UA, Configuration::VALID_OPTIONS_KEYS

Instance Method Summary collapse

Methods included from Authentication

#login

Methods included from Configuration

extended, #options, #reset

Constructor Details

#initialize(options = {}) ⇒ API

Creates a new API and copies settings from singleton



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

def initialize(options = {})
  options = Hudu.options.merge(options)
  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/hudu/api.rb', line 20

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