Class: ChatbotHelper::Telegram::Game

Inherits:
BaseResource show all
Defined in:
lib/chatbot_helper/telegram/game.rb

Overview

The game resource which represents a Telegram bot API game

Instance Attribute Summary

Attributes inherited from BaseResource

#hash

Class Method Summary collapse

Methods inherited from BaseResource

#==, #initialize, required_objects, #to_s, valid_resource!, valid_resource?

Constructor Details

This class inherits a constructor from ChatbotHelper::Telegram::BaseResource

Class Method Details

.optional_arraysObject



26
27
28
29
30
31
# File 'lib/chatbot_helper/telegram/game.rb', line 26

def optional_arrays
  [
    { name: 'text_entities',
      type: ChatbotHelper::Telegram::MessageEntity }
  ]
end

.optional_fieldsObject



10
11
12
# File 'lib/chatbot_helper/telegram/game.rb', line 10

def optional_fields
  %w[text]
end

.optional_objectsObject



14
15
16
17
18
# File 'lib/chatbot_helper/telegram/game.rb', line 14

def optional_objects
  [
    { name: 'animation', type: ChatbotHelper::Telegram::Animation }
  ]
end

.required_arraysObject



20
21
22
23
24
# File 'lib/chatbot_helper/telegram/game.rb', line 20

def required_arrays
  [
    { name: 'photo', type: ChatbotHelper::Telegram::PhotoSize }
  ]
end

.required_fieldsObject



6
7
8
# File 'lib/chatbot_helper/telegram/game.rb', line 6

def required_fields
  %w[title description]
end