Class: AlexaRuby::Card

Inherits:
Object
  • Object
show all
Defined in:
lib/alexa_ruby/response/card.rb

Overview

Class for Amazon Alexa app cards

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Hash

Initialize new card object

Raises:

  • (ArgumentError)

    if card type is unknown


16
17
18
19
20
21
22
# File 'lib/alexa_ruby/response/card.rb', line 16

def initialize(params)
  @obj = {}
  @obj[:type] = params[:type] || 'Simple'
  raise ArgumentError, 'Unknown card type' unless valid_type?
  @params = params
  build
end

Instance Attribute Details

#objObject (readonly)

Returns the value of attribute obj


4
5
6
# File 'lib/alexa_ruby/response/card.rb', line 4

def obj
  @obj
end