Class: Alexa::Device
- Inherits:
-
Object
- Object
- Alexa::Device
- Defined in:
- lib/alexa/device.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
Instance Method Summary collapse
- #audio_supported? ⇒ Boolean
-
#id ⇒ Object
Return device id.
-
#initialize(attributes: {}, context:) ⇒ Device
constructor
A new instance of Device.
-
#location ⇒ Object
Return device location from amazon.
- #video_supported? ⇒ Boolean
Constructor Details
#initialize(attributes: {}, context:) ⇒ Device
Returns a new instance of Device.
7 8 9 10 |
# File 'lib/alexa/device.rb', line 7 def initialize(attributes: {}, context:) @attributes = attributes @context = context end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
6 7 8 |
# File 'lib/alexa/device.rb', line 6 def attributes @attributes end |
Instance Method Details
#audio_supported? ⇒ Boolean
18 19 20 |
# File 'lib/alexa/device.rb', line 18 def audio_supported? attributes["supportedInterfaces"].keys.include?("AudioPlayer") end |
#id ⇒ Object
Return device id
14 15 16 |
# File 'lib/alexa/device.rb', line 14 def id attributes["deviceId"] end |
#location ⇒ Object
Return device location from amazon. Makes an API to amazon alexa’s device location service and returns the location hash
30 31 32 |
# File 'lib/alexa/device.rb', line 30 def location @_location ||= get_location end |
#video_supported? ⇒ Boolean
22 23 24 |
# File 'lib/alexa/device.rb', line 22 def video_supported? attributes["supportedInterfaces"].keys.include?("VideoApp") end |