Class: Audio

Inherits:
Common2 show all
Defined in:
lib/objects/audio.rb

Overview

Monday, August 24 2020

This object represents an audio file to be treated as music by the Telegram clients.

Instance Method Summary collapse

Methods inherited from Common2

#file_id, #file_size, #file_unique_id, #mime_type

Constructor Details

#initialize(audio) ⇒ Audio

:nodoc:



11
12
13
# File 'lib/objects/audio.rb', line 11

def initialize(audio) # :nodoc:
  super(audio)
end

Instance Method Details

#durationObject

Duration of the audio in seconds as defined by sender.



16
17
18
# File 'lib/objects/audio.rb', line 16

def duration
  @obj.duration
end

#performerObject

Optional. Performer of the audio as defined by sender or by audio tags.



21
22
23
# File 'lib/objects/audio.rb', line 21

def performer
  @obj.performer
end

#thumbObject

Optional. Thumbnail of the album cover to which the music file belongs.



31
32
33
34
35
36
# File 'lib/objects/audio.rb', line 31

def thumb
  data = @obj.thumb
  return PhotoSize.new(data) if data

  false
end

#titleObject

Optional. Title of the audio as defined by sender or by audio tags



26
27
28
# File 'lib/objects/audio.rb', line 26

def title
  @obj.title
end