Class: Buildkite::Builder::Extension
- Inherits:
-
Object
- Object
- Buildkite::Builder::Extension
- Defined in:
- lib/buildkite/builder/extension.rb
Direct Known Subclasses
Buildkite::Builder::Extensions::Agents, Buildkite::Builder::Extensions::Env, Buildkite::Builder::Extensions::Lib, Buildkite::Builder::Extensions::Notify, Buildkite::Builder::Extensions::Plugins, Buildkite::Builder::Extensions::Steps, Buildkite::Builder::Extensions::Use
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#options_block ⇒ Object
readonly
Returns the value of attribute options_block.
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(context, **options, &block) ⇒ Extension
constructor
A new instance of Extension.
Constructor Details
#initialize(context, **options, &block) ⇒ Extension
Returns a new instance of Extension.
32 33 34 35 36 37 38 |
# File 'lib/buildkite/builder/extension.rb', line 32 def initialize(context, **, &block) @context = context @options = @options_block = block prepare end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
28 29 30 |
# File 'lib/buildkite/builder/extension.rb', line 28 def context @context end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
29 30 31 |
# File 'lib/buildkite/builder/extension.rb', line 29 def @options end |
#options_block ⇒ Object (readonly)
Returns the value of attribute options_block.
30 31 32 |
# File 'lib/buildkite/builder/extension.rb', line 30 def @options_block end |
Class Method Details
.dsl(&block) ⇒ Object
8 9 10 11 |
# File 'lib/buildkite/builder/extension.rb', line 8 def dsl(&block) @dsl = Module.new(&block) if block_given? @dsl end |
.template(name = :default, &block) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/buildkite/builder/extension.rb', line 13 def template(name = :default, &block) name = name.to_s if block_given? && templates.key?(name) raise ArgumentError, "Template #{name} already registered in #{self.name}" end templates[name] ||= ExtensionTemplate.new(self, name, block) end |
.templates ⇒ Object
23 24 25 |
# File 'lib/buildkite/builder/extension.rb', line 23 def templates @templates ||= {} end |
Instance Method Details
#build ⇒ Object
40 41 42 |
# File 'lib/buildkite/builder/extension.rb', line 40 def build # Override to provide extra functionality. end |