Module: Qpid::Proton::Util::Wrapper

Included in:
Codec::Data, Connection, Event, Link, Message, Receiver, SSL, Session, Transfer, Transport
Defined in:
lib/util/wrapper.rb

Overview

Instance methods to include in classes that wrap pn_object types that support pn_inspect etc. Automatically extends SWIGClassHelper

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#implObject



128
129
130
# File 'lib/util/wrapper.rb', line 128

def impl
  @impl
end

Class Method Details

.included(base) ⇒ Object



124
125
126
# File 'lib/util/wrapper.rb', line 124

def self.included(base)
  base.extend(SWIGClassHelper)
end

.registryObject



143
144
145
# File 'lib/util/wrapper.rb', line 143

def self.registry
  @registry ||= {}
end

Instance Method Details

#inspectObject



130
131
132
133
134
135
136
137
138
139
# File 'lib/util/wrapper.rb', line 130

def inspect
  return "#{self.class}<nil>" unless @impl
  pstr = Cproton.pn_string("")
  begin
    Cproton.pn_inspect(@impl, pstr)
    return Cproton.pn_string_get(pstr)
  ensure
    Cproton.pn_free(pstr)
  end
end

#to_sObject



141
# File 'lib/util/wrapper.rb', line 141

def to_s() inspect; end