Sha256: 428833ddd90f8eeab909a92cf189df4980f4e141ed388540174e28f27258f731

Contents?: true

Size: 865 Bytes

Versions: 16

Compression:

Stored size: 865 Bytes

Contents

# frozen_string_literal: true

module Bolt
  class PAL
    class YamlPlan
      class Step
        class Message < Step
          def self.allowed_keys
            super + Set['message']
          end

          def self.required_keys
            Set['message']
          end

          # Returns an array of arguments to pass to the step's function call
          #
          private def format_args(body)
            [body['message']]
          end

          # Returns the function corresponding to the step
          #
          private def function
            'out::message'
          end

          # Transpiles the step into the plan language
          #
          def transpile
            code = String.new("  ")
            code << function_call(function, format_args(body))
            code << "\n"
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
bolt-3.13.0 lib/bolt/pal/yaml_plan/step/message.rb
bolt-3.12.0 lib/bolt/pal/yaml_plan/step/message.rb
bolt-3.11.0 lib/bolt/pal/yaml_plan/step/message.rb
bolt-3.10.0 lib/bolt/pal/yaml_plan/step/message.rb
bolt-3.9.2 lib/bolt/pal/yaml_plan/step/message.rb
bolt-3.9.1 lib/bolt/pal/yaml_plan/step/message.rb
bolt-3.9.0 lib/bolt/pal/yaml_plan/step/message.rb
bolt-3.8.1 lib/bolt/pal/yaml_plan/step/message.rb
bolt-3.8.0 lib/bolt/pal/yaml_plan/step/message.rb
bolt-3.7.1 lib/bolt/pal/yaml_plan/step/message.rb
bolt-3.7.0 lib/bolt/pal/yaml_plan/step/message.rb
bolt-3.6.1 lib/bolt/pal/yaml_plan/step/message.rb
bolt-3.6.0 lib/bolt/pal/yaml_plan/step/message.rb
bolt-3.5.0 lib/bolt/pal/yaml_plan/step/message.rb
bolt-3.4.0 lib/bolt/pal/yaml_plan/step/message.rb
bolt-3.3.0 lib/bolt/pal/yaml_plan/step/message.rb