Class: AlexaWebService::Card
- Inherits:
-
Object
- Object
- AlexaWebService::Card
- Defined in:
- lib/alexa_web_service/card.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#large_image ⇒ Object
Returns the value of attribute large_image.
-
#permissions ⇒ Object
Returns the value of attribute permissions.
-
#small_image ⇒ Object
Returns the value of attribute small_image.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#add_permission(permission) ⇒ Object
Will only return permissions requested in skill configuration Possible values for permissions: write for notifications: “write::alexa:devices:all:notifications:standard” read for full address: “read::alexa:device:all:address” read for restricted address: “read::alexa:device:all:address:country_and_postal_code”.
-
#initialize(type = 'text_card') ⇒ Card
constructor
A new instance of Card.
- #linking ⇒ Object
- #with_image ⇒ Object
- #with_permission ⇒ Object
- #with_text ⇒ Object
Constructor Details
#initialize(type = 'text_card') ⇒ Card
Returns a new instance of Card.
5 6 7 8 9 10 11 12 |
# File 'lib/alexa_web_service/card.rb', line 5 def initialize(type = 'text_card') @title = '' @content = '' @small_image = nil @large_image = nil @type = type = [] end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
3 4 5 |
# File 'lib/alexa_web_service/card.rb', line 3 def content @content end |
#large_image ⇒ Object
Returns the value of attribute large_image.
3 4 5 |
# File 'lib/alexa_web_service/card.rb', line 3 def large_image @large_image end |
#permissions ⇒ Object
Returns the value of attribute permissions.
3 4 5 |
# File 'lib/alexa_web_service/card.rb', line 3 def end |
#small_image ⇒ Object
Returns the value of attribute small_image.
3 4 5 |
# File 'lib/alexa_web_service/card.rb', line 3 def small_image @small_image end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/alexa_web_service/card.rb', line 3 def title @title end |
Instance Method Details
#add_permission(permission) ⇒ Object
Will only return permissions requested in skill configuration Possible values for permissions: write for notifications: “write::alexa:devices:all:notifications:standard” read for full address: “read::alexa:device:all:address” read for restricted address: “read::alexa:device:all:address:country_and_postal_code”
44 45 46 |
# File 'lib/alexa_web_service/card.rb', line 44 def () self. << end |
#linking ⇒ Object
34 35 36 |
# File 'lib/alexa_web_service/card.rb', line 34 def linking {"type": "LinkAccount"} end |
#with_image ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/alexa_web_service/card.rb', line 14 def with_image { "type": "Standard", "title": title, "text": content, "image": { "smallImageUrl": small_image, "largeImageUrl": large_image } } end |
#with_permission ⇒ Object
48 49 50 51 52 |
# File 'lib/alexa_web_service/card.rb', line 48 def { "type": "AskForPermissionsConsent", "permissions": } end |
#with_text ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/alexa_web_service/card.rb', line 26 def with_text { "type": "Simple", "title": title, "content": content } end |