Class: Sticker

Inherits:
TFile show all
Defined in:
lib/objects/sticker.rb

Overview

This object represents a sticker. Extends from TFile

Instance Method Summary collapse

Methods inherited from TFile

#file_id, #file_path, #file_size, #file_unique_id

Constructor Details

#initialize(sticker) ⇒ Sticker

:nodoc:



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

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

Instance Method Details

#animated?Boolean

True, if the sticker is animated

Returns:

  • (Boolean)


27
28
29
# File 'lib/objects/sticker.rb', line 27

def animated?
  @sticker.is_animated
end

#emojiObject

Optional. Emoji associated with the sticker



40
41
42
# File 'lib/objects/sticker.rb', line 40

def emoji
  @sticker.emoji
end

#heightObject

Sticker height



22
23
24
# File 'lib/objects/sticker.rb', line 22

def height
  @sticker.height
end

#mask_positionObject



49
50
51
52
53
54
# File 'lib/objects/sticker.rb', line 49

def mask_position
  msk_pos = @sticker.mask_position
  return MaskPosition.new(msk_pos) if msk_pos

  false
end

#set_nameObject

Optional. Name of the sticker set to which the sticker belongs.



45
46
47
# File 'lib/objects/sticker.rb', line 45

def set_name
  @sticker.set_name
end

#thumbObject

Optional. Sticker thumbnail in the .WEBP or .JPG format



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

def thumb
  tmb = @sticker.thumb
  return PhotoSize.new(tmb) if tmb

  false
end

#widthObject

Sticker width



17
18
19
# File 'lib/objects/sticker.rb', line 17

def width
  @file.width
end