lib/submodules/ably-ruby/lib/ably/models/protocol_message.rb in ably-rest-1.1.6 vs lib/submodules/ably-ruby/lib/ably/models/protocol_message.rb in ably-rest-1.1.7

- old
+ new

@@ -183,9 +183,17 @@ Array(attributes[:presence]).map do |message| Ably::Models.PresenceMessage(message, protocol_message: self) end end + def message_size + presence.map(&:size).sum + messages.map(&:size).sum + end + + def has_correct_message_size? + message_size <= connection_details.max_message_size + end + def flags Integer(attributes[:flags]) rescue TypeError 0 end