Class: Audio
Overview
Monday, August 24 2020
This object represents an audio file to be treated as music by the Telegram clients.
Instance Method Summary collapse
-
#duration ⇒ Object
Duration of the audio in seconds as defined by sender.
-
#initialize(audio) ⇒ Audio
constructor
:nodoc:.
-
#performer ⇒ Object
Optional.Performer of the audio as defined by sender or by audio tags. -
#thumb ⇒ Object
Optional.Thumbnail of the album cover to which the music file belongs. -
#title ⇒ Object
Optional.
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
#duration ⇒ Object
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 |
#performer ⇒ Object
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 |
#thumb ⇒ Object
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 |
#title ⇒ Object
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 |