Class: AlexaRuby::Device

Inherits:
Object
  • Object
show all
Defined in:
lib/alexa_ruby/request/base_request/context/device.rb

Overview

User device parameters

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(device) ⇒ Device

Initialize new device

Parameters:

  • device (Hash)

    user device parameters

Raises:

  • (ArgumentError)

    if device ID is nil



10
11
12
13
14
# File 'lib/alexa_ruby/request/base_request/context/device.rb', line 10

def initialize(device)
  raise ArgumentError, 'Missing device ID' if device[:deviceId].nil?
  @id = device[:deviceId]
  load_interfaces(device[:supportedInterfaces])
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/alexa_ruby/request/base_request/context/device.rb', line 4

def id
  @id
end

#interfacesObject (readonly)

Returns the value of attribute interfaces.



4
5
6
# File 'lib/alexa_ruby/request/base_request/context/device.rb', line 4

def interfaces
  @interfaces
end