Class: SlackWebApi::MessageObject

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/slack_web_api/models/message_object.rb

Overview

MessageObject Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(text:, ts:, type:, attachments: SKIP, blocks: SKIP, bot_id: SKIP, bot_profile: SKIP, client_msg_id: SKIP, comment: SKIP, display_as_bot: SKIP, file: SKIP, files: SKIP, icons: SKIP, inviter: SKIP, is_delayed_message: SKIP, is_intro: SKIP, is_starred: SKIP, last_read: SKIP, latest_reply: SKIP, name: SKIP, old_name: SKIP, parent_user_id: SKIP, permalink: SKIP, pinned_to: SKIP, purpose: SKIP, reactions: SKIP, reply_count: SKIP, reply_users: SKIP, reply_users_count: SKIP, source_team: SKIP, subscribed: SKIP, subtype: SKIP, team: SKIP, thread_ts: SKIP, topic: SKIP, unread_count: SKIP, upload: SKIP, user: SKIP, user_profile: SKIP, user_team: SKIP, username: SKIP, additional_properties: nil) ⇒ MessageObject

Returns a new instance of MessageObject.



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# File 'lib/slack_web_api/models/message_object.rb', line 312

def initialize(text:, ts:, type:, attachments: SKIP, blocks: SKIP,
               bot_id: SKIP, bot_profile: SKIP, client_msg_id: SKIP,
               comment: SKIP, display_as_bot: SKIP, file: SKIP, files: SKIP,
               icons: SKIP, inviter: SKIP, is_delayed_message: SKIP,
               is_intro: SKIP, is_starred: SKIP, last_read: SKIP,
               latest_reply: SKIP, name: SKIP, old_name: SKIP,
               parent_user_id: SKIP, permalink: SKIP, pinned_to: SKIP,
               purpose: SKIP, reactions: SKIP, reply_count: SKIP,
               reply_users: SKIP, reply_users_count: SKIP,
               source_team: SKIP, subscribed: SKIP, subtype: SKIP,
               team: SKIP, thread_ts: SKIP, topic: SKIP, unread_count: SKIP,
               upload: SKIP, user: SKIP, user_profile: SKIP,
               user_team: SKIP, username: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @attachments = attachments unless attachments == SKIP
  @blocks = blocks unless blocks == SKIP
  @bot_id = bot_id unless bot_id == SKIP
  @bot_profile = bot_profile unless bot_profile == SKIP
  @client_msg_id = client_msg_id unless client_msg_id == SKIP
  @comment = comment unless comment == SKIP
  @display_as_bot = display_as_bot unless display_as_bot == SKIP
  @file = file unless file == SKIP
  @files = files unless files == SKIP
  @icons = icons unless icons == SKIP
  @inviter = inviter unless inviter == SKIP
  @is_delayed_message = is_delayed_message unless is_delayed_message == SKIP
  @is_intro = is_intro unless is_intro == SKIP
  @is_starred = is_starred unless is_starred == SKIP
  @last_read = last_read unless last_read == SKIP
  @latest_reply = latest_reply unless latest_reply == SKIP
  @name = name unless name == SKIP
  @old_name = old_name unless old_name == SKIP
  @parent_user_id = parent_user_id unless parent_user_id == SKIP
  @permalink = permalink unless permalink == SKIP
  @pinned_to = pinned_to unless pinned_to == SKIP
  @purpose = purpose unless purpose == SKIP
  @reactions = reactions unless reactions == SKIP
  @reply_count = reply_count unless reply_count == SKIP
  @reply_users = reply_users unless reply_users == SKIP
  @reply_users_count = reply_users_count unless reply_users_count == SKIP
  @source_team = source_team unless source_team == SKIP
  @subscribed = subscribed unless subscribed == SKIP
  @subtype = subtype unless subtype == SKIP
  @team = team unless team == SKIP
  @text = text
  @thread_ts = thread_ts unless thread_ts == SKIP
  @topic = topic unless topic == SKIP
  @ts = ts
  @type = type
  @unread_count = unread_count unless unread_count == SKIP
  @upload = upload unless upload == SKIP
  @user = user unless user == SKIP
  @user_profile =  unless  == SKIP
  @user_team = user_team unless user_team == SKIP
  @username = username unless username == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#attachmentsArray[Attachment]

TODO: Write general description for this method

Returns:



14
15
16
# File 'lib/slack_web_api/models/message_object.rb', line 14

def attachments
  @attachments
end

#blocksArray[BlockKitBlock]

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:



19
20
21
# File 'lib/slack_web_api/models/message_object.rb', line 19

def blocks
  @blocks
end

#bot_idObject

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (Object)


24
25
26
# File 'lib/slack_web_api/models/message_object.rb', line 24

def bot_id
  @bot_id
end

#bot_profileBotProfileObject

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:



29
30
31
# File 'lib/slack_web_api/models/message_object.rb', line 29

def bot_profile
  @bot_profile
end

#client_msg_idString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


34
35
36
# File 'lib/slack_web_api/models/message_object.rb', line 34

def client_msg_id
  @client_msg_id
end

#commentFileCommentObject

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:



39
40
41
# File 'lib/slack_web_api/models/message_object.rb', line 39

def comment
  @comment
end

#display_as_botTrueClass | FalseClass

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (TrueClass | FalseClass)


44
45
46
# File 'lib/slack_web_api/models/message_object.rb', line 44

def display_as_bot
  @display_as_bot
end

#fileFileObject

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:



49
50
51
# File 'lib/slack_web_api/models/message_object.rb', line 49

def file
  @file
end

#filesArray[FileObject]

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:



54
55
56
# File 'lib/slack_web_api/models/message_object.rb', line 54

def files
  @files
end

#iconsIcons1

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:



59
60
61
# File 'lib/slack_web_api/models/message_object.rb', line 59

def icons
  @icons
end

#inviterString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


64
65
66
# File 'lib/slack_web_api/models/message_object.rb', line 64

def inviter
  @inviter
end

#is_delayed_messageTrueClass | FalseClass

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (TrueClass | FalseClass)


69
70
71
# File 'lib/slack_web_api/models/message_object.rb', line 69

def is_delayed_message
  @is_delayed_message
end

#is_introTrueClass | FalseClass

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (TrueClass | FalseClass)


74
75
76
# File 'lib/slack_web_api/models/message_object.rb', line 74

def is_intro
  @is_intro
end

#is_starredTrueClass | FalseClass

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (TrueClass | FalseClass)


79
80
81
# File 'lib/slack_web_api/models/message_object.rb', line 79

def is_starred
  @is_starred
end

#last_readString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


84
85
86
# File 'lib/slack_web_api/models/message_object.rb', line 84

def last_read
  @last_read
end

#latest_replyString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


89
90
91
# File 'lib/slack_web_api/models/message_object.rb', line 89

def latest_reply
  @latest_reply
end

#nameString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


94
95
96
# File 'lib/slack_web_api/models/message_object.rb', line 94

def name
  @name
end

#old_nameString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


99
100
101
# File 'lib/slack_web_api/models/message_object.rb', line 99

def old_name
  @old_name
end

#parent_user_idString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


104
105
106
# File 'lib/slack_web_api/models/message_object.rb', line 104

def parent_user_id
  @parent_user_id
end

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


109
110
111
# File 'lib/slack_web_api/models/message_object.rb', line 109

def permalink
  @permalink
end

#pinned_toArray[String]

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (Array[String])


114
115
116
# File 'lib/slack_web_api/models/message_object.rb', line 114

def pinned_to
  @pinned_to
end

#purposeString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


119
120
121
# File 'lib/slack_web_api/models/message_object.rb', line 119

def purpose
  @purpose
end

#reactionsArray[ReactionObject]

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:



124
125
126
# File 'lib/slack_web_api/models/message_object.rb', line 124

def reactions
  @reactions
end

#reply_countInteger

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (Integer)


129
130
131
# File 'lib/slack_web_api/models/message_object.rb', line 129

def reply_count
  @reply_count
end

#reply_usersArray[String]

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (Array[String])


134
135
136
# File 'lib/slack_web_api/models/message_object.rb', line 134

def reply_users
  @reply_users
end

#reply_users_countInteger

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (Integer)


139
140
141
# File 'lib/slack_web_api/models/message_object.rb', line 139

def reply_users_count
  @reply_users_count
end

#source_teamString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


144
145
146
# File 'lib/slack_web_api/models/message_object.rb', line 144

def source_team
  @source_team
end

#subscribedTrueClass | FalseClass

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (TrueClass | FalseClass)


149
150
151
# File 'lib/slack_web_api/models/message_object.rb', line 149

def subscribed
  @subscribed
end

#subtypeString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


154
155
156
# File 'lib/slack_web_api/models/message_object.rb', line 154

def subtype
  @subtype
end

#teamString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


159
160
161
# File 'lib/slack_web_api/models/message_object.rb', line 159

def team
  @team
end

#textString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


164
165
166
# File 'lib/slack_web_api/models/message_object.rb', line 164

def text
  @text
end

#thread_tsString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


169
170
171
# File 'lib/slack_web_api/models/message_object.rb', line 169

def thread_ts
  @thread_ts
end

#topicString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


174
175
176
# File 'lib/slack_web_api/models/message_object.rb', line 174

def topic
  @topic
end

#tsString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


179
180
181
# File 'lib/slack_web_api/models/message_object.rb', line 179

def ts
  @ts
end

#typeString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


184
185
186
# File 'lib/slack_web_api/models/message_object.rb', line 184

def type
  @type
end

#unread_countInteger

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (Integer)


189
190
191
# File 'lib/slack_web_api/models/message_object.rb', line 189

def unread_count
  @unread_count
end

#uploadTrueClass | FalseClass

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (TrueClass | FalseClass)


194
195
196
# File 'lib/slack_web_api/models/message_object.rb', line 194

def upload
  @upload
end

#userString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


199
200
201
# File 'lib/slack_web_api/models/message_object.rb', line 199

def user
  @user
end

#user_profileObjsUserProfileShort

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.



204
205
206
# File 'lib/slack_web_api/models/message_object.rb', line 204

def 
  @user_profile
end

#user_teamString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


209
210
211
# File 'lib/slack_web_api/models/message_object.rb', line 209

def user_team
  @user_team
end

#usernameString

This is a very loose definition, in the future, we’ll populate this with deeper schema in this definition namespace.

Returns:

  • (String)


214
215
216
# File 'lib/slack_web_api/models/message_object.rb', line 214

def username
  @username
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
# File 'lib/slack_web_api/models/message_object.rb', line 373

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  text = hash.key?('text') ? hash['text'] : nil
  ts = hash.key?('ts') ? hash['ts'] : nil
  type = hash.key?('type') ? hash['type'] : nil
  # Parameter is an array, so we need to iterate through it
  attachments = nil
  unless hash['attachments'].nil?
    attachments = []
    hash['attachments'].each do |structure|
      attachments << (Attachment.from_hash(structure) if structure)
    end
  end

  attachments = SKIP unless hash.key?('attachments')
  # Parameter is an array, so we need to iterate through it
  blocks = nil
  unless hash['blocks'].nil?
    blocks = []
    hash['blocks'].each do |structure|
      blocks << (BlockKitBlock.from_hash(structure) if structure)
    end
  end

  blocks = SKIP unless hash.key?('blocks')
  bot_id = hash.key?('bot_id') ? hash['bot_id'] : SKIP
  bot_profile = BotProfileObject.from_hash(hash['bot_profile']) if hash['bot_profile']
  client_msg_id = hash.key?('client_msg_id') ? hash['client_msg_id'] : SKIP
  comment = FileCommentObject.from_hash(hash['comment']) if hash['comment']
  display_as_bot =
    hash.key?('display_as_bot') ? hash['display_as_bot'] : SKIP
  file = FileObject.from_hash(hash['file']) if hash['file']
  # Parameter is an array, so we need to iterate through it
  files = nil
  unless hash['files'].nil?
    files = []
    hash['files'].each do |structure|
      files << (FileObject.from_hash(structure) if structure)
    end
  end

  files = SKIP unless hash.key?('files')
  icons = Icons1.from_hash(hash['icons']) if hash['icons']
  inviter = hash.key?('inviter') ? hash['inviter'] : SKIP
  is_delayed_message =
    hash.key?('is_delayed_message') ? hash['is_delayed_message'] : SKIP
  is_intro = hash.key?('is_intro') ? hash['is_intro'] : SKIP
  is_starred = hash.key?('is_starred') ? hash['is_starred'] : SKIP
  last_read = hash.key?('last_read') ? hash['last_read'] : SKIP
  latest_reply = hash.key?('latest_reply') ? hash['latest_reply'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  old_name = hash.key?('old_name') ? hash['old_name'] : SKIP
  parent_user_id =
    hash.key?('parent_user_id') ? hash['parent_user_id'] : SKIP
  permalink = hash.key?('permalink') ? hash['permalink'] : SKIP
  pinned_to = hash.key?('pinned_to') ? hash['pinned_to'] : SKIP
  purpose = hash.key?('purpose') ? hash['purpose'] : SKIP
  # Parameter is an array, so we need to iterate through it
  reactions = nil
  unless hash['reactions'].nil?
    reactions = []
    hash['reactions'].each do |structure|
      reactions << (ReactionObject.from_hash(structure) if structure)
    end
  end

  reactions = SKIP unless hash.key?('reactions')
  reply_count = hash.key?('reply_count') ? hash['reply_count'] : SKIP
  reply_users = hash.key?('reply_users') ? hash['reply_users'] : SKIP
  reply_users_count =
    hash.key?('reply_users_count') ? hash['reply_users_count'] : SKIP
  source_team = hash.key?('source_team') ? hash['source_team'] : SKIP
  subscribed = hash.key?('subscribed') ? hash['subscribed'] : SKIP
  subtype = hash.key?('subtype') ? hash['subtype'] : SKIP
  team = hash.key?('team') ? hash['team'] : SKIP
  thread_ts = hash.key?('thread_ts') ? hash['thread_ts'] : SKIP
  topic = hash.key?('topic') ? hash['topic'] : SKIP
  unread_count = hash.key?('unread_count') ? hash['unread_count'] : SKIP
  upload = hash.key?('upload') ? hash['upload'] : SKIP
  user = hash.key?('user') ? hash['user'] : SKIP
   = ObjsUserProfileShort.from_hash(hash['user_profile']) if hash['user_profile']
  user_team = hash.key?('user_team') ? hash['user_team'] : SKIP
  username = hash.key?('username') ? hash['username'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  MessageObject.new(text: text,
                    ts: ts,
                    type: type,
                    attachments: attachments,
                    blocks: blocks,
                    bot_id: bot_id,
                    bot_profile: bot_profile,
                    client_msg_id: client_msg_id,
                    comment: comment,
                    display_as_bot: display_as_bot,
                    file: file,
                    files: files,
                    icons: icons,
                    inviter: inviter,
                    is_delayed_message: is_delayed_message,
                    is_intro: is_intro,
                    is_starred: is_starred,
                    last_read: last_read,
                    latest_reply: latest_reply,
                    name: name,
                    old_name: old_name,
                    parent_user_id: parent_user_id,
                    permalink: permalink,
                    pinned_to: pinned_to,
                    purpose: purpose,
                    reactions: reactions,
                    reply_count: reply_count,
                    reply_users: reply_users,
                    reply_users_count: reply_users_count,
                    source_team: source_team,
                    subscribed: subscribed,
                    subtype: subtype,
                    team: team,
                    thread_ts: thread_ts,
                    topic: topic,
                    unread_count: unread_count,
                    upload: upload,
                    user: user,
                    user_profile: ,
                    user_team: user_team,
                    username: username,
                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# File 'lib/slack_web_api/models/message_object.rb', line 217

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['attachments'] = 'attachments'
  @_hash['blocks'] = 'blocks'
  @_hash['bot_id'] = 'bot_id'
  @_hash['bot_profile'] = 'bot_profile'
  @_hash['client_msg_id'] = 'client_msg_id'
  @_hash['comment'] = 'comment'
  @_hash['display_as_bot'] = 'display_as_bot'
  @_hash['file'] = 'file'
  @_hash['files'] = 'files'
  @_hash['icons'] = 'icons'
  @_hash['inviter'] = 'inviter'
  @_hash['is_delayed_message'] = 'is_delayed_message'
  @_hash['is_intro'] = 'is_intro'
  @_hash['is_starred'] = 'is_starred'
  @_hash['last_read'] = 'last_read'
  @_hash['latest_reply'] = 'latest_reply'
  @_hash['name'] = 'name'
  @_hash['old_name'] = 'old_name'
  @_hash['parent_user_id'] = 'parent_user_id'
  @_hash['permalink'] = 'permalink'
  @_hash['pinned_to'] = 'pinned_to'
  @_hash['purpose'] = 'purpose'
  @_hash['reactions'] = 'reactions'
  @_hash['reply_count'] = 'reply_count'
  @_hash['reply_users'] = 'reply_users'
  @_hash['reply_users_count'] = 'reply_users_count'
  @_hash['source_team'] = 'source_team'
  @_hash['subscribed'] = 'subscribed'
  @_hash['subtype'] = 'subtype'
  @_hash['team'] = 'team'
  @_hash['text'] = 'text'
  @_hash['thread_ts'] = 'thread_ts'
  @_hash['topic'] = 'topic'
  @_hash['ts'] = 'ts'
  @_hash['type'] = 'type'
  @_hash['unread_count'] = 'unread_count'
  @_hash['upload'] = 'upload'
  @_hash['user'] = 'user'
  @_hash['user_profile'] = 'user_profile'
  @_hash['user_team'] = 'user_team'
  @_hash['username'] = 'username'
  @_hash
end

.nullablesObject

An array for nullable fields



308
309
310
# File 'lib/slack_web_api/models/message_object.rb', line 308

def self.nullables
  []
end

.optionalsObject

An array for optional fields



264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/slack_web_api/models/message_object.rb', line 264

def self.optionals
  %w[
    attachments
    blocks
    bot_id
    bot_profile
    client_msg_id
    comment
    display_as_bot
    file
    files
    icons
    inviter
    is_delayed_message
    is_intro
    is_starred
    last_read
    latest_reply
    name
    old_name
    parent_user_id
    permalink
    pinned_to
    purpose
    reactions
    reply_count
    reply_users
    reply_users_count
    source_team
    subscribed
    subtype
    team
    thread_ts
    topic
    unread_count
    upload
    user
    user_profile
    user_team
    username
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
# File 'lib/slack_web_api/models/message_object.rb', line 530

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} attachments: #{@attachments.inspect}, blocks: #{@blocks.inspect}, bot_id:"\
  " #{@bot_id.inspect}, bot_profile: #{@bot_profile.inspect}, client_msg_id:"\
  " #{@client_msg_id.inspect}, comment: #{@comment.inspect}, display_as_bot:"\
  " #{@display_as_bot.inspect}, file: #{@file.inspect}, files: #{@files.inspect}, icons:"\
  " #{@icons.inspect}, inviter: #{@inviter.inspect}, is_delayed_message:"\
  " #{@is_delayed_message.inspect}, is_intro: #{@is_intro.inspect}, is_starred:"\
  " #{@is_starred.inspect}, last_read: #{@last_read.inspect}, latest_reply:"\
  " #{@latest_reply.inspect}, name: #{@name.inspect}, old_name: #{@old_name.inspect},"\
  " parent_user_id: #{@parent_user_id.inspect}, permalink: #{@permalink.inspect}, pinned_to:"\
  " #{@pinned_to.inspect}, purpose: #{@purpose.inspect}, reactions: #{@reactions.inspect},"\
  " reply_count: #{@reply_count.inspect}, reply_users: #{@reply_users.inspect},"\
  " reply_users_count: #{@reply_users_count.inspect}, source_team: #{@source_team.inspect},"\
  " subscribed: #{@subscribed.inspect}, subtype: #{@subtype.inspect}, team: #{@team.inspect},"\
  " text: #{@text.inspect}, thread_ts: #{@thread_ts.inspect}, topic: #{@topic.inspect}, ts:"\
  " #{@ts.inspect}, type: #{@type.inspect}, unread_count: #{@unread_count.inspect}, upload:"\
  " #{@upload.inspect}, user: #{@user.inspect}, user_profile: #{@user_profile.inspect},"\
  " user_team: #{@user_team.inspect}, username: #{@username.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
# File 'lib/slack_web_api/models/message_object.rb', line 512

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} attachments: #{@attachments}, blocks: #{@blocks}, bot_id: #{@bot_id},"\
  " bot_profile: #{@bot_profile}, client_msg_id: #{@client_msg_id}, comment: #{@comment},"\
  " display_as_bot: #{@display_as_bot}, file: #{@file}, files: #{@files}, icons: #{@icons},"\
  " inviter: #{@inviter}, is_delayed_message: #{@is_delayed_message}, is_intro: #{@is_intro},"\
  " is_starred: #{@is_starred}, last_read: #{@last_read}, latest_reply: #{@latest_reply},"\
  " name: #{@name}, old_name: #{@old_name}, parent_user_id: #{@parent_user_id}, permalink:"\
  " #{@permalink}, pinned_to: #{@pinned_to}, purpose: #{@purpose}, reactions: #{@reactions},"\
  " reply_count: #{@reply_count}, reply_users: #{@reply_users}, reply_users_count:"\
  " #{@reply_users_count}, source_team: #{@source_team}, subscribed: #{@subscribed}, subtype:"\
  " #{@subtype}, team: #{@team}, text: #{@text}, thread_ts: #{@thread_ts}, topic: #{@topic},"\
  " ts: #{@ts}, type: #{@type}, unread_count: #{@unread_count}, upload: #{@upload}, user:"\
  " #{@user}, user_profile: #{@user_profile}, user_team: #{@user_team}, username:"\
  " #{@username}, additional_properties: #{@additional_properties}>"
end