Class: WorkflowStepResult_Shim

Inherits:
Object
  • Object
show all
Defined in:
lib/openstudio/workflow_json.rb

Overview

WorkflowStepResult_Shim provides a shim interface to the WorkflowStepResult class in OpenStudio 2.X when running in OpenStudio 1.X

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ WorkflowStepResult_Shim

Returns a new instance of WorkflowStepResult_Shim.



100
101
102
# File 'lib/openstudio/workflow_json.rb', line 100

def initialize(result)
  @result = result
end

Instance Method Details

#setStepResult(step_result) ⇒ Object



142
143
144
# File 'lib/openstudio/workflow_json.rb', line 142

def setStepResult(step_result)
  @result[:step_result] = step_result
end

#stepErrorsObject



118
119
120
# File 'lib/openstudio/workflow_json.rb', line 118

def stepErrors
  return @result[:step_errors]
end

#stepFinalConditionObject



111
112
113
114
115
116
# File 'lib/openstudio/workflow_json.rb', line 111

def stepFinalCondition
  if @result[:final_condition]
    return Optional_Shim.new(@result[:final_condition])
  end
  return Optional_Shim.new(nil)
end

#stepInfoObject



126
127
128
# File 'lib/openstudio/workflow_json.rb', line 126

def stepInfo
  return @result[:step_info]
end

#stepInitialConditionObject



104
105
106
107
108
109
# File 'lib/openstudio/workflow_json.rb', line 104

def stepInitialCondition
  if @result[:initial_condition]
    return Optional_Shim.new(@result[:initial_condition])
  end
  return Optional_Shim.new(nil)
end

#stepResultObject



138
139
140
# File 'lib/openstudio/workflow_json.rb', line 138

def stepResult
  Optional_Shim.new(@result[:step_result])
end

#stepValuesObject



130
131
132
133
134
135
136
# File 'lib/openstudio/workflow_json.rb', line 130

def stepValues
  result = []
  @result[:step_values].each do |step_value|
    result << WorkflowStepResultValue_Shim.new(step_value[:name], step_value[:value], step_value[:type])
  end
  return result
end

#stepWarningsObject



122
123
124
# File 'lib/openstudio/workflow_json.rb', line 122

def stepWarnings
  return @result[:step_warnings]
end