Module | Qpid::Proton::Util::SwigHelper |
In: |
lib/util/swig_helper.rb
|
Provides helper functions for writing wrapper functions for the underlying C APIs.
Before defining any mutators the class must define the name of the prefix for methods with the constant PROTON_METOD_PREFIX.
There are three types of wrappers that are supported:
attribute.
avoids repetitive boiler plate coding.
you can also declare that the method uses "is" instead of "get" in the underlying API. Such methods are then defined with "?"
@example
class Terminus include WrapperHelper PROTON_METHOD_PREFIX = "pn_terminus" # add methods "type" and "type=" that call "pn_terminus_{get,set}_type" proton_accessor :type # adds the method "dynamic?" that calls "pn_terminus_is_dynamic" proton_accessor :dynamic, :is_or_get => :is # adds a method named "foo" that calls "pn_terminus_foo" proton_caller :foo end
@private