Module: Jenkins::Plugin::Proxy

Overview

The Jenkins Ruby API uses “proxies” which are Java subclasses of the native Jenkins Java API. These proxies provide the mapping between the Java API and the idomatic Ruby API. Sometimes these mappings can appear convoluted, but it is only so in order to make the Ruby side as simple and clean as possible.

This module provides common functionality for all proxies.

Defined Under Namespace

Modules: ClassMethods, Customs, InstanceMethods, Marshal, ProxyFor, Unmarshal

Instance Method Summary collapse

Methods included from Behavior

extended, implemented, included

Methods included from Behavior::BehavesAs

#behaves_as

Instance Method Details

#getTargetObject

tell Stapler to go look for views from the wrapped object



35
36
37
# File 'lib/jenkins/plugin/proxy.rb', line 35

def getTarget
  @object
end

#initialize(plugin, object, *super_args) ⇒ Object

Every Proxy object has a reference to the plugin to which it belongs, as well as the native Ruby object which it represents.

Parameters:

  • plugin (Jenkins::Plugin)

    the plugin from whence this proxy object came

  • object (Object)

    the implementation to which this proxy will delegate.

  • super_args

    pass through arguments to the super type



27
28
29
30
31
32
# File 'lib/jenkins/plugin/proxy.rb', line 27

def initialize(plugin, object, *super_args)
  super(*super_args) if defined? super
  @plugin, @object = plugin, object
  @pluginid = @plugin.name
  @plugin.linkout object, self
end