Class: Alexa::API::Base

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/alexa/api/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

camelize, safe_retrieve

Constructor Details

#initialize(credentials) ⇒ Base

Returns a new instance of Base.



8
9
10
11
12
13
# File 'lib/alexa/api/base.rb', line 8

def initialize(credentials)
  if MultiXml.parser.to_s == "MultiXml::Parsers::Ox"
    raise StandardError, "MultiXml parser is set to :ox - alexa gem will not work with it currently, use one of: :libxml, :nokogiri, :rexml"
  end
  @credentials = credentials
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



6
7
8
# File 'lib/alexa/api/base.rb', line 6

def arguments
  @arguments
end

#response_bodyObject (readonly)

Returns the value of attribute response_body.



6
7
8
# File 'lib/alexa/api/base.rb', line 6

def response_body
  @response_body
end

Instance Method Details

#parsed_bodyObject



15
16
17
# File 'lib/alexa/api/base.rb', line 15

def parsed_body
  @parsed_body ||= MultiXml.parse(response_body)
end