Class: AP::API

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/ap/api.rb

Direct Known Subclasses

Client, Search

Defined Under Namespace

Classes: MissingAPIKeyError

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ API

Returns a new instance of API.



9
10
11
12
# File 'lib/ap/api.rb', line 9

def initialize(options = {})
  options = AP.options.merge(options)
  self.class.default_params :apiKey => options[:api_key]
end

Class Method Details

.get(*args) ⇒ Object

Raises:



14
15
16
17
# File 'lib/ap/api.rb', line 14

def self.get(*args)
  raise MissingAPIKeyError if default_params.nil? || default_params[:apiKey].nil? || default_params[:apiKey].empty?
  super
end