Class: PostProxy::Message

Inherits:
Model
  • Object
show all
Defined in:
lib/postproxy/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#to_h

Constructor Details

#initialize(**attrs) ⇒ Message

Returns a new instance of Message.



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
# File 'lib/postproxy/types.rb', line 415

def initialize(**attrs)
  @external_id = nil
  @body = nil
  @tag = nil
  @external_comment_id = nil
  @error_message = nil
  @platform_data = nil
  @external_posted_at = nil
  @external_delivered_at = nil
  @external_read_at = nil
  @external_edited_at = nil
  @reply_to_external_id = nil
  @reply_markup = nil
  @external_deleted_at = nil
  @reactions = []
  @attachments = []
  @is_unsupported = false
  super
  @external_posted_at = parse_time(@external_posted_at)
  @external_delivered_at = parse_time(@external_delivered_at)
  @external_read_at = parse_time(@external_read_at)
  @external_edited_at = parse_time(@external_edited_at)
  @external_deleted_at = parse_time(@external_deleted_at)
  @created_at = parse_time(@created_at)
  @reactions = (@reactions || []).map do |r|
    r.is_a?(Reaction) ? r : Reaction.new(**r.transform_keys(&:to_sym))
  end
  @attachments = (@attachments || []).map do |a|
    a.is_a?(Attachment) ? a : Attachment.new(**a.transform_keys(&:to_sym))
  end
end

Instance Attribute Details

#attachmentsObject

Returns the value of attribute attachments.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def attachments
  @attachments
end

#bodyObject

Returns the value of attribute body.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def body
  @body
end

#chat_idObject

Returns the value of attribute chat_id.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def chat_id
  @chat_id
end

#created_atObject

Returns the value of attribute created_at.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def created_at
  @created_at
end

#directionObject

Returns the value of attribute direction.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def direction
  @direction
end

#error_messageObject

Returns the value of attribute error_message.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def error_message
  @error_message
end

#external_comment_idObject

Returns the value of attribute external_comment_id.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def external_comment_id
  @external_comment_id
end

#external_deleted_atObject

Returns the value of attribute external_deleted_at.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def external_deleted_at
  @external_deleted_at
end

#external_delivered_atObject

Returns the value of attribute external_delivered_at.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def external_delivered_at
  @external_delivered_at
end

#external_edited_atObject

Returns the value of attribute external_edited_at.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def external_edited_at
  @external_edited_at
end

#external_idObject

Returns the value of attribute external_id.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def external_id
  @external_id
end

#external_posted_atObject

Returns the value of attribute external_posted_at.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def external_posted_at
  @external_posted_at
end

#external_read_atObject

Returns the value of attribute external_read_at.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def external_read_at
  @external_read_at
end

#idObject

Returns the value of attribute id.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def id
  @id
end

#is_unsupportedObject

Returns the value of attribute is_unsupported.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def is_unsupported
  @is_unsupported
end

#platform_dataObject

Returns the value of attribute platform_data.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def platform_data
  @platform_data
end

#reactionsObject

Returns the value of attribute reactions.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def reactions
  @reactions
end

#reply_markupObject

Returns the value of attribute reply_markup.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def reply_markup
  @reply_markup
end

#reply_to_external_idObject

Returns the value of attribute reply_to_external_id.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def reply_to_external_id
  @reply_to_external_id
end

#statusObject

Returns the value of attribute status.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def status
  @status
end

#tagObject

Returns the value of attribute tag.



408
409
410
# File 'lib/postproxy/types.rb', line 408

def tag
  @tag
end