Class: AlexaRuby::Card
- Inherits:
-
Object
- Object
- AlexaRuby::Card
- Defined in:
- lib/alexa_ruby/response/card.rb
Overview
Class for Amazon Alexa app cards
Instance Attribute Summary collapse
-
#obj ⇒ Object
Returns the value of attribute obj.
Instance Method Summary collapse
-
#build(opts) ⇒ Object
Build card object.
-
#initialize ⇒ Card
constructor
Initialize new card object.
Constructor Details
#initialize ⇒ Card
Initialize new card object
7 8 9 |
# File 'lib/alexa_ruby/response/card.rb', line 7 def initialize @obj = {} end |
Instance Attribute Details
#obj ⇒ Object
Returns the value of attribute obj.
4 5 6 |
# File 'lib/alexa_ruby/response/card.rb', line 4 def obj @obj end |
Instance Method Details
#build(opts) ⇒ Object
Build card object
18 19 20 21 22 23 |
# File 'lib/alexa_ruby/response/card.rb', line 18 def build(opts) @obj[:type] = opts[:type] @obj[:title] = opts[:title] unless opts[:title].nil? @obj[:subtitle] = opts[:subtitle] unless opts[:subtitle].nil? @obj[:content] = opts[:content] unless opts[:content].nil? end |