Class: Alexa::Connection
- Inherits:
-
Object
- Object
- Alexa::Connection
- Defined in:
- lib/alexa/connection.rb
Constant Summary collapse
- HEADERS =
{ "Content-Type" => "application/xml", "Accept" => "application/xml", "User-Agent" => "Ruby alexa gem v#{Alexa::VERSION}" }
Instance Attribute Summary collapse
-
#access_key_id ⇒ Object
readonly
Returns the value of attribute access_key_id.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#secret_access_key ⇒ Object
readonly
Returns the value of attribute secret_access_key.
Instance Method Summary collapse
- #get(params = {}) ⇒ Object
-
#initialize(credentials = {}) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(credentials = {}) ⇒ Connection
Returns a new instance of Connection.
15 16 17 18 |
# File 'lib/alexa/connection.rb', line 15 def initialize(credentials = {}) @secret_access_key = credentials.fetch(:secret_access_key) @access_key_id = credentials.fetch(:access_key_id) end |
Instance Attribute Details
#access_key_id ⇒ Object (readonly)
Returns the value of attribute access_key_id.
7 8 9 |
# File 'lib/alexa/connection.rb', line 7 def access_key_id @access_key_id end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
7 8 9 |
# File 'lib/alexa/connection.rb', line 7 def params @params end |
#secret_access_key ⇒ Object (readonly)
Returns the value of attribute secret_access_key.
7 8 9 |
# File 'lib/alexa/connection.rb', line 7 def secret_access_key @secret_access_key end |
Instance Method Details
#get(params = {}) ⇒ Object
20 21 22 23 |
# File 'lib/alexa/connection.rb', line 20 def get(params = {}) @params = params handle_response(request).body.force_encoding(Encoding::UTF_8) end |