Class: Qpid::Proton::Described

Inherits:
Object
  • Object
show all
Defined in:
lib/qpid_proton/described.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(descriptor, value) ⇒ Described

Returns a new instance of Described.



29
30
31
32
# File 'lib/qpid_proton/described.rb', line 29

def initialize(descriptor, value)
  @descriptor = descriptor
  @value = value
end

Instance Attribute Details

#descriptorObject (readonly)

Returns the value of attribute descriptor.



26
27
28
# File 'lib/qpid_proton/described.rb', line 26

def descriptor
  @descriptor
end

#valueObject (readonly)

Returns the value of attribute value.



27
28
29
# File 'lib/qpid_proton/described.rb', line 27

def value
  @value
end

Instance Method Details

#==(that) ⇒ Object

:nodoc:



52
53
54
55
56
# File 'lib/qpid_proton/described.rb', line 52

def ==(that) # :nodoc:
  (that.is_a?(Qpid::Proton::Described) &&
   (self.descriptor == that.descriptor) &&
   (self.value == that.value))
end

#put(data) ⇒ Object

Puts the description into the Data object.

Arguments

  • data - the Qpid::Proton::Data instance

Examples

described = Qpid::Proton::Described.new("my-descriptor", "the value")
data = Qpid::Proton::Data.new
...
described.put(data)


47
48
49
50
# File 'lib/qpid_proton/described.rb', line 47

def put(data)
  data.symbol = @descriptor
  data.string = @value
end

#to_sObject

:nodoc:



58
59
60
# File 'lib/qpid_proton/described.rb', line 58

def to_s # :nodoc:
  "descriptor=#{descriptor} value=#{value}"
end