class Eso::StepConfiguration

Attributes

configurationParams[RW]
previousTypeName[RW]
typeName[RW]
workflowID[RW]

Public Class Methods

new(typeName, previousTypeName, configurationParams=nil, workflowID=nil) click to toggle source
# File lib/eso/step_configuration.rb, line 23
def initialize (typeName, previousTypeName, configurationParams=nil, workflowID=nil)
  @typeName = typeName
  @previousTypeName = previousTypeName
  @configurationParams = configurationParams ? configurationParams : {
      :valueClass => Values::OBJECT,
      :objectType => 'params',
      :properties => {}}
  @workflowID = workflowID if workflowID
end

Public Instance Methods

add_property(name, value) click to toggle source

This adds the specified property to this StepConfiguration.configurationParams.properties Hash

@param [String] name The name of the property to add, which should be one of ConfigParamProperties @param [Object] value The value of the property to add, which should already be in the appropriate format (Eso::Values) @return [StepConfiguration] Returns this object for chaining.

# File lib/eso/step_configuration.rb, line 38
def add_property(name, value)
  @configurationParams[:properties][name] =
      case name
        when *ConfigParamPropertyTypes::BOOLEAN
          {
              valueClass: Values::BOOLEAN,
              value: value
          }
        when *ConfigParamPropertyTypes::INTEGER
          {
              valueClass: Values::INTEGER,
              value: value
          }
        when *ConfigParamPropertyTypes::STRING
          {
              valueClass: Values::STRING,
              value: value
          }
        else
          raise ArgumentError, "Invalid StepConfiguration ConfigurationParameter Property name: #{name}. " +
              'Should be one of StepConfiguration::ConfigParamProperties'
      end
  self
end
to_h() click to toggle source
# File lib/eso/step_configuration.rb, line 63
def to_h
  hash = {
      :typeName => @typeName,
      :previousTypeName => @previousTypeName,
      :configurationParams => @configurationParams
  }
  hash['workflowID'] = @workflowID if @workflowID
  hash
end