Class: Qpid::Proton::Types::Described

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(descriptor, value) ⇒ Described

Returns a new instance of Described.



28
29
30
31
# File 'lib/types/described.rb', line 28

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

Instance Attribute Details

#descriptorObject (readonly)

Returns the value of attribute descriptor.



25
26
27
# File 'lib/types/described.rb', line 25

def descriptor
  @descriptor
end

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#==(that) ⇒ Object

:nodoc:



51
52
53
54
55
# File 'lib/types/described.rb', line 51

def ==(that) # :nodoc:
  (that.is_a?(Qpid::Proton::Types::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)


46
47
48
49
# File 'lib/types/described.rb', line 46

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

#to_sObject

:nodoc:



57
58
59
# File 'lib/types/described.rb', line 57

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