Class: Ably::Models::DeltaExtras

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

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.



21
22
23
# File 'lib/submodules/ably-ruby/lib/ably/models/delta_extras.rb', line 21

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

Instance Attribute Details

#formatString? (readonly)

The delta format.

Returns:

  • (String, nil)


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/submodules/ably-ruby/lib/ably/models/delta_extras.rb', line 8

class DeltaExtras
  include Ably::Modules::ModelCommon

  # The id of the message the delta was generated from.
  # @return [String, nil]
  #
  attr_reader :from

  # The delta format.
  # @return [String, nil]
  #
  attr_reader :format

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

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

#fromString? (readonly)

The id of the message the delta was generated from.

Returns:

  • (String, nil)


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/submodules/ably-ruby/lib/ably/models/delta_extras.rb', line 8

class DeltaExtras
  include Ably::Modules::ModelCommon

  # The id of the message the delta was generated from.
  # @return [String, nil]
  #
  attr_reader :from

  # The delta format.
  # @return [String, nil]
  #
  attr_reader :format

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

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

Instance Method Details

#to_json(*args) ⇒ Object



25
26
27
# File 'lib/submodules/ably-ruby/lib/ably/models/delta_extras.rb', line 25

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