class FantasticRobot::Request::SendVideo

This object represents a sendVideo request

Constants

MAX_FILE_SIZE

Attributes

caption[RW]
chat_id[RW]
duration[RW]
reply_markup[RW]
reply_to_message_id[RW]
video[RW]

Public Class Methods

new(attributes = {}) click to toggle source
Calls superclass method FantasticRobot::Request::Base::new
# File lib/fantastic_robot/request/send_video.rb, line 15
def initialize(attributes = {})
  super(attributes)
  @method = :sendVideo
end

Private Instance Methods

file_length() click to toggle source

Function to check that the file size isn’t excesive.

# File lib/fantastic_robot/request/send_video.rb, line 23
def file_length
  if self.video.is_a?(File) && self.video.size > MAX_FILE_SIZE
    self.errors.add :video, "It's length is excesive. #{MAX_FILE_SIZE} is the limit."
    return false
  end

  return true
end