class Qpid::Proton::Disposition

Disposition records the current state and/or final outcome of a transfer.

Every delivery contains both a local and a remote disposition. The local disposition holds the local state of the delivery, and the remote disposition holds the *last known* remote state of the delivery.

Constants

PROTON_METHOD_PREFIX

@private

Attributes

impl[R]

Public Class Methods

new(impl, local) click to toggle source

@private

# File lib/core/disposition.rb, line 49
def initialize(impl, local)
  @impl = impl
  @local = local
  @data = nil
  @condition = nil
  @annotations = nil
end

Public Instance Methods

annotations() click to toggle source

Returns the annotations for the disposition.

@return [Codec::Data] The annotations.

# File lib/core/disposition.rb, line 125
def annotations
  if @local
    @annotations
  else
    data_to_object(Cproton.pn_disposition_annotations(@impl))
  end
end
annotations=(annotations) click to toggle source

Sets the annotations for the disposition.

@param annotations [Codec::Data] The annotations.

@raise [AttributeError] If the disposition is remote.

# File lib/core/disposition.rb, line 116
def annotations=(annotations)
  raise AttributeError.new("annotations attribute is read-only") unless @local
  @annotations = annotations
end
condition() click to toggle source

Returns the condition of the disposition.

@return [Codec::Data] The condition of the disposition.

# File lib/core/disposition.rb, line 148
def condition
  if @local
    @condition
  else
    condition_to_object(Cproton.pn_disposition_condition(@impl))
  end
end
condition=(condition) click to toggle source

Sets the condition for the disposition.

@param condition [Codec::Data] The condition.

@raise [AttributeError] If the disposition is remote.

# File lib/core/disposition.rb, line 139
def condition=(condition)
  raise AttributeError.new("condition attribute is read-only") unless @local
  @condition = condition
end
data() click to toggle source

Returns the data for the disposition.

@return [Codec::Data] The data.

# File lib/core/disposition.rb, line 102
def data
  if @local
    @data
  else
    data_to_object(Cproton.pn_disposition_data(@impl))
  end
end
data=(data) click to toggle source

Sets the data for the disposition.

@param data [Codec::Data] The data.

@raise [AttributeError] If the disposition is remote.

# File lib/core/disposition.rb, line 93
def data=(data)
  raise AttributeError.new("data attribute is read-only") unless @local
  @data = data
end