Sha256: c0a851551d40e1835c04404f2c33fbc1244565afb2e2c19d2d76d4982eee297e

Contents?: true

Size: 788 Bytes

Versions: 78

Compression:

Stored size: 788 Bytes

Contents

# frozen_string_literal: true

module Bolt
  class PAL
    class YamlPlan
      class Step
        class Plan < Step
          def self.allowed_keys
            super + Set['plan', 'parameters']
          end

          def self.required_keys
            Set.new
          end

          def initialize(step_body)
            super
            @plan = step_body['plan']
            @parameters = step_body.fetch('parameters', {})
          end

          def transpile
            code = String.new("  ")
            code << "$#{@name} = " if @name

            fn = 'run_plan'
            args = [@plan]
            args << @parameters unless @parameters.empty?

            code << function_call(fn, args)

            code << "\n"
          end
        end
      end
    end
  end
end

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
bolt-2.26.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.25.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.24.1 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.24.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.23.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.22.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.21.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.20.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.19.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.18.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.17.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.16.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.15.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.14.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.13.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.12.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.11.1 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.11.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.10.0 lib/bolt/pal/yaml_plan/step/plan.rb
bolt-2.9.0 lib/bolt/pal/yaml_plan/step/plan.rb