Class: Animation

Inherits:
Common show all
Defined in:
lib/objects/animation.rb

Overview

Sunday, August 23 2020

This object represents an animation file.

(GIF or H.264/MPEG-4 AVC video without sound).

Instance Method Summary collapse

Methods inherited from Common

#file_id, #file_size, #file_unique_id, #heigth, #width

Constructor Details

#initialize(obj) ⇒ Animation

:nodoc:



12
13
14
15
# File 'lib/objects/animation.rb', line 12

def initialize(obj) # :nodoc:
  super(obj)
  freeze
end

Instance Method Details

#durationObject

Duration of the video in seconds as defined by sender.



18
19
20
# File 'lib/objects/animation.rb', line 18

def duration
  @obj.duration
end

#file_nameObject

Optional. Original animation filename as defined by sender.



23
24
25
# File 'lib/objects/animation.rb', line 23

def file_name
  @obj.file_name
end

#mime_typeObject

Optional. MIME type of the file as defined by sender.



28
29
30
# File 'lib/objects/animation.rb', line 28

def mime_type
  @obj.mime_type
end

#thumbObject



32
33
34
35
36
37
# File 'lib/objects/animation.rb', line 32

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

  false
end