Class: Alexa::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/alexa/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration = {}) ⇒ Client

Returns a new instance of Client.


5
6
7
8
# File 'lib/alexa/client.rb', line 5

def initialize(configuration = {})
  @access_key_id     = configuration[:access_key_id]     || raise(ArgumentError.new("You must specify access_key_id"))
  @secret_access_key = configuration[:secret_access_key] || raise(ArgumentError.new("You must specify secret_access_key"))
end

Instance Attribute Details

#access_key_idObject (readonly)

Returns the value of attribute access_key_id


3
4
5
# File 'lib/alexa/client.rb', line 3

def access_key_id
  @access_key_id
end

#secret_access_keyObject (readonly)

Returns the value of attribute secret_access_key


3
4
5
# File 'lib/alexa/client.rb', line 3

def secret_access_key
  @secret_access_key
end

Instance Method Details

#category_browse(arguments = {}) ⇒ Object


10
11
12
# File 'lib/alexa/client.rb', line 10

def category_browse(arguments = {})
  API::CategoryBrowse.new(:access_key_id => access_key_id, :secret_access_key => secret_access_key).fetch(arguments)
end

#category_listings(arguments = {}) ⇒ Object


14
15
16
# File 'lib/alexa/client.rb', line 14

def category_listings(arguments = {})
  API::CategoryListings.new(:access_key_id => access_key_id, :secret_access_key => secret_access_key).fetch(arguments)
end

#sites_linking_in(arguments = {}) ⇒ Object


18
19
20
# File 'lib/alexa/client.rb', line 18

def sites_linking_in(arguments = {})
  API::SitesLinkingIn.new(:access_key_id => access_key_id, :secret_access_key => secret_access_key).fetch(arguments)
end

#traffic_history(arguments = {}) ⇒ Object


22
23
24
# File 'lib/alexa/client.rb', line 22

def traffic_history(arguments = {})
  API::TrafficHistory.new(:access_key_id => access_key_id, :secret_access_key => secret_access_key).fetch(arguments)
end

#url_info(arguments = {}) ⇒ Object


26
27
28
# File 'lib/alexa/client.rb', line 26

def url_info(arguments = {})
  API::UrlInfo.new(:access_key_id => access_key_id, :secret_access_key => secret_access_key).fetch(arguments)
end