Class: ChatbotHelper::Telegram::MessageEntity

Inherits:
BaseResource
  • Object
show all
Defined in:
lib/chatbot_helper/telegram/message_entity.rb

Overview

The message_entity resource which represents a Telegram bot API message_entity

Instance Attribute Summary

Attributes inherited from BaseResource

#hash

Class Method Summary collapse

Methods inherited from BaseResource

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

Constructor Details

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

Class Method Details

.optional_fieldsObject



11
12
13
# File 'lib/chatbot_helper/telegram/message_entity.rb', line 11

def optional_fields
  %w[url]
end

.optional_objectsObject



15
16
17
18
19
# File 'lib/chatbot_helper/telegram/message_entity.rb', line 15

def optional_objects
  [
    { name: 'user', type: ChatbotHelper::Telegram::User }
  ]
end

.required_fieldsObject



7
8
9
# File 'lib/chatbot_helper/telegram/message_entity.rb', line 7

def required_fields
  %w[type offset length]
end