Class: Alexa::Client
- Inherits:
-
Object
- Object
- Alexa::Client
- Defined in:
- lib/alexa/client.rb
Instance Attribute Summary collapse
-
#access_key_id ⇒ Object
readonly
Returns the value of attribute access_key_id.
-
#secret_access_key ⇒ Object
readonly
Returns the value of attribute secret_access_key.
Instance Method Summary collapse
- #category_browse(arguments = {}) ⇒ Object
- #category_listings(arguments = {}) ⇒ Object
-
#initialize(configuration = {}) ⇒ Client
constructor
A new instance of Client.
- #sites_linking_in(arguments = {}) ⇒ Object
- #traffic_history(arguments = {}) ⇒ Object
- #url_info(arguments = {}) ⇒ Object
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_id ⇒ Object (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_key ⇒ Object (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 |