Class: Bot::Message::Video

Inherits:
Base
  • Object
show all
Defined in:
lib/bot/messages/video.rb

Instance Attribute Summary

Attributes inherited from Base

#message

Instance Method Summary collapse

Methods inherited from Base

#as_json, #method_missing

Constructor Details

#initialize(to, photo_url, suggested_responses = false, options = {}) ⇒ Video

Returns a new instance of Video.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/bot/messages/video.rb', line 4

def initialize(to, photo_url, suggested_responses=false, options={})
  self.message = {
    'type'      => 'video',
    'to'        => to,
    'videoUrl'  => photo_url,
    'loop'      => false,
    'muted'     => false,
    'autoplay'  => false,
    'noSave'    => true,
  }.merge(options)

  self.message['chatId'] = options['chatId'] if options['chatId']
  self.suggested_responses = suggested_responses
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Bot::Message::Base