Class: TD::Types::Base

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/tdlib/types/base.rb

Direct Known Subclasses

AccountTtl, Address, Animation, Animations, Audio, AuthenticationCodeInfo, AuthenticationCodeType, AuthorizationState, AutoDownloadSettings, AutoDownloadSettingsPresets, Background, BackgroundType, Backgrounds, BasicGroup, BasicGroupFullInfo, BotCommand, BotInfo, Call, CallConnection, CallDiscardReason, CallId, CallProblem, CallProtocol, CallState, CallbackQueryAnswer, CallbackQueryPayload, Chat, ChatAction, ChatEvent, ChatEventAction, ChatEventLogFilters, ChatEvents, ChatInviteLink, ChatInviteLinkInfo, ChatMember, ChatMemberStatus, ChatMembers, ChatMembersFilter, ChatNotificationSettings, ChatPermissions, ChatPhoto, ChatReportReason, ChatReportSpamState, ChatType, Chats, CheckChatUsernameResult, ConnectedWebsite, ConnectedWebsites, ConnectionState, Contact, Count, CustomRequestResult, DatabaseStatistics, Date, DatedFile, DeepLinkInfo, DeviceToken, Document, DraftMessage, EmailAddressAuthenticationCodeInfo, Emojis, EncryptedCredentials, EncryptedPassportElement, Error, File, FilePart, FileType, FormattedText, FoundMessages, Game, GameHighScore, GameHighScores, Hashtags, HttpUrl, IdentityDocument, ImportedContacts, InlineKeyboardButton, InlineKeyboardButtonType, InlineQueryResult, InlineQueryResults, InputBackground, InputCredentials, InputFile, InputIdentityDocument, InputInlineQueryResult, InputMessageContent, InputPassportElement, InputPassportElementError, InputPassportElementErrorSource, InputPersonalDocument, InputSticker, InputThumbnail, Invoice, JsonObjectMember, JsonValue, KeyboardButton, KeyboardButtonType, LabeledPricePart, LanguagePackInfo, LanguagePackString, LanguagePackStringValue, LanguagePackStrings, LinkState, LocalFile, LocalizationTargetInfo, Location, LogStream, LogTags, LogVerbosityLevel, MaskPoint, MaskPosition, Message, MessageContent, MessageForwardInfo, MessageForwardOrigin, MessageLinkInfo, MessageSendingState, Messages, Minithumbnail, NetworkStatistics, NetworkStatisticsEntry, NetworkType, Notification, NotificationGroup, NotificationGroupType, NotificationSettingsScope, NotificationType, Ok, OptionValue, OrderInfo, PageBlock, PageBlockCaption, PageBlockHorizontalAlignment, PageBlockListItem, PageBlockRelatedArticle, PageBlockTableCell, PageBlockVerticalAlignment, PassportAuthorizationForm, PassportElement, PassportElementError, PassportElementErrorSource, PassportElementType, PassportElements, PassportElementsWithErrors, PassportRequiredElement, PassportSuitableElement, PasswordState, PaymentForm, PaymentReceipt, PaymentResult, PaymentsProviderStripe, PersonalDetails, PersonalDocument, PhoneNumberAuthenticationSettings, Photo, PhotoSize, Poll, PollOption, ProfilePhoto, Proxies, Proxy, ProxyType, PublicMessageLink, PushMessageContent, PushReceiverId, RecoveryEmailAddress, RemoteFile, ReplyMarkup, RichText, SavedCredentials, ScopeNotificationSettings, SearchMessagesFilter, Seconds, SecretChat, SecretChatState, Session, Sessions, ShippingOption, Sticker, StickerSet, StickerSetInfo, StickerSets, Stickers, StorageStatistics, StorageStatisticsByChat, StorageStatisticsByFileType, StorageStatisticsFast, Supergroup, SupergroupFullInfo, SupergroupMembersFilter, TMeUrl, TMeUrlType, TMeUrls, TdlibParameters, TemporaryPasswordState, TermsOfService, Text, TextEntities, TextEntity, TextEntityType, TextParseMode, TopChatCategory, Update, Updates, User, UserFullInfo, UserPrivacySetting, UserPrivacySettingRule, UserPrivacySettingRules, UserProfilePhoto, UserProfilePhotos, UserStatus, UserType, Users, ValidatedOrderInfo, Venue, Video, VideoNote, VoiceNote, WebPage, WebPageInstantView

Instance Method Summary collapse

Instance Method Details

#to_hashObject Also known as: to_h



20
21
22
# File 'lib/tdlib/types/base.rb', line 20

def to_hash
  { '@type' => LOOKUP_TABLE.key(self.class.name.sub('TD::Types::', '')) }.merge(super)
end

#to_json(*args) ⇒ Object



25
26
27
# File 'lib/tdlib/types/base.rb', line 25

def to_json(*args)
  to_hash.to_json(*args)
end