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: Customs, Marshal, Unmarshal

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(mod) ⇒ Object



13
14
15
16
17
18
# File 'lib/jenkins/plugin/proxy.rb', line 13

def self.included(mod)
  super
  mod.extend(Marshal)
  mod.send(:include, Unmarshal)
  mod.send(:include, Customs)
end

Instance Method Details

#getTargetObject



33
34
35
# File 'lib/jenkins/plugin/proxy.rb', line 33

def getTarget
  @object
end

#initialize(plugin, object) ⇒ 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.



25
26
27
28
29
# File 'lib/jenkins/plugin/proxy.rb', line 25

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