Class: Ably::Models::DeltaExtras

Inherits:
Object
  • Object
show all
Includes:
Ably::Modules::ModelCommon
Defined in:
lib/ably/models/delta_extras.rb

Overview

Contains any arbitrary key-value pairs, which may also contain other primitive JSON types, JSON-encodable objects, or JSON-encodable arrays from delta compression.

Instance Attribute Summary collapse

Attributes included from Ably::Modules::ModelCommon

#hash

Instance Method Summary collapse

Methods included from Ably::Modules::ModelCommon

#==, #[], #as_json, included, #to_s

Methods included from Ably::Modules::MessagePack

#to_msgpack

Constructor Details

#initialize(attributes = {}) ⇒ DeltaExtras

Returns a new instance of DeltaExtras.



20
21
22
# File 'lib/ably/models/delta_extras.rb', line 20

def initialize(attributes = {})
  @from, @format = IdiomaticRubyWrapper((attributes || {}), stop_at: [:from, :format]).attributes.values_at(:from, :format)
end

Instance Attribute Details

#formatString? (readonly)

The delta compression format. Only vcdiff is supported.

Returns:

  • (String, nil)


18
19
20
# File 'lib/ably/models/delta_extras.rb', line 18

def format
  @format
end

#fromString? (readonly)

The ID of the message the delta was generated from.

Returns:

  • (String, nil)


12
13
14
# File 'lib/ably/models/delta_extras.rb', line 12

def from
  @from
end

Instance Method Details

#to_json(*args) ⇒ Object



24
25
26
# File 'lib/ably/models/delta_extras.rb', line 24

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