Sha256: c04195aca26f7028b305ab2beaa64e738e639c3dc27ac0a69bc8718fb67d719b

Contents?: true

Size: 703 Bytes

Versions: 3

Compression:

Stored size: 703 Bytes

Contents

# frozen_string_literal: true

require "forwardable"

module Buildkite
  module Pipelines
    module Steps
      class Abstract
        extend Forwardable
        include Attributes

        def_delegator :@context, :data

        attr_reader :pipeline
        attr_reader :template

        def self.to_sym
          name.split('::').last.downcase.to_sym
        end

        def initialize(pipeline, template = nil, **args, &block)
          @pipeline = pipeline
          @template = template
          @context = StepContext.new(self, **args)

          instance_exec(@context, &template) if template
          instance_exec(@context, &block) if block_given?
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
buildkite-builder-1.4.1 lib/buildkite/pipelines/steps/abstract.rb
buildkite-builder-1.4.0 lib/buildkite/pipelines/steps/abstract.rb
buildkite-builder-1.3.1 lib/buildkite/pipelines/steps/abstract.rb