Module: Jenkins::Model::Describable
- Extended by:
- Plugin::Behavior
- Includes:
- Extension
- Included in:
- DescribableNative, Slaves::NodeProperty, Tasks::BuildWrapper, Tasks::Builder, Tasks::Publisher
- Defined in:
- lib/jenkins/model/describable.rb
Overview
When Jenkins is searching for all the extension points of a particular type… let’s say ‘Builder` for example. It first asks for all the `Descriptor`s registered to describe the `Builder` type. It will then use the descriptors it finds to do things like construct and validate the extension objects.
It helps me to think about the Jenkins ‘Descriptor` as a Ruby class. It is a factory for instances, and contains data about what those instances can do.
This module, when included, provides a single class method ‘describe_as` which tell Jenkins in effect “when you are looking for Java Classes of this type” you can use this ruby class too. e.g.
class Builder
include Jenkins::Model::Describable
describe_as Java.hudson.tasks.Builder
descriptor_is Jenkins::Tasks::BuildStepDescriptor
end
behind the scenes, this creates a ‘Descriptor` instance registered against the java type `Java.hudson.tasks.Builder`. Now, any time Jenkins asks about what kind of `hudson.tasks.Builder`s there are in the system, this class will come up.
This class should generally not be needed by plugin authors since it is part of the glue layer and not the public runtime API.
Defined Under Namespace
Modules: ClassMethods, DescribeAs
Constant Summary collapse
- DescribableError =
Class.new(StandardError)
Method Summary
Methods included from Plugin::Behavior
extended, implemented, included