Class: XapiScraper::Models::Components::MessageModel

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
Crystalline::MetadataFields
Defined in:
lib/xapi_scraper/models/components/messagemodel.rb

Overview

Message model

Instance Method Summary collapse

Methods included from Crystalline::MetadataFields

#field, #fields, included, #marshal_single, #to_dict, #to_json

Constructor Details

#initialize(id:, text:, time:, attachment: nil, attachments: nil, sequence_id: nil, sender_id: nil, recipient_id: nil) ⇒ MessageModel

Returns a new instance of MessageModel.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/xapi_scraper/models/components/messagemodel.rb', line 64

def initialize(
  id:,
  text:,
  time:,
  attachment: nil,
  attachments: nil,
  sequence_id: nil,
  sender_id: nil,
  recipient_id: nil
)
  @id = id
  @text = text
  @time = time
  @attachment = attachment
  @attachments = attachments
  @sequence_id = sequence_id
  @sender_id = sender_id
  @recipient_id = recipient_id
end

Instance Method Details

#==(other) ⇒ Object



85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/xapi_scraper/models/components/messagemodel.rb', line 85

def ==(other)
  return false unless other.is_a?(self.class)
  return false unless @id == other.id
  return false unless @text == other.text
  return false unless @time == other.time
  return false unless @attachment == other.attachment
  return false unless @attachments == other.attachments
  return false unless @sequence_id == other.sequence_id
  return false unless @sender_id == other.sender_id
  return false unless @recipient_id == other.recipient_id
  true
end