class FantasticRobot::Request::SendAudio
This object represents a sendAudio request
Constants
- MAX_FILE_SIZE
Attributes
audio[RW]
chat_id[RW]
duration[RW]
performer[RW]
reply_markup[RW]
reply_to_message_id[RW]
title[RW]
Public Class Methods
new(attributes = {})
click to toggle source
Calls superclass method
FantasticRobot::Request::Base::new
# File lib/fantastic_robot/request/send_audio.rb, line 15 def initialize(attributes = {}) super(attributes) @method = :sendAudio 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_audio.rb, line 23 def file_length if self.audio.is_a?(File) && self.audio.size > MAX_FILE_SIZE self.errors.add :audio, "It's length is excesive. #{MAX_FILE_SIZE} is the limit." return false end return true end