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:
Defines a set-only method for the named attribute.
Defines a get-only method for the named attribute.
Defines both a set- and a get-method for the named
attribute.
A simple wrapper for calling an underlying method,
avoids repetitive boiler plate coding.
For both the getter and the mutator types
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
# File lib/util/swig_helper.rb, line 66 def self.included(base) base.extend ClassMethods end