Class: Lev::Routine::Result
- Inherits:
-
Object
- Object
- Lev::Routine::Result
- Defined in:
- lib/lev/routine.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#outputs ⇒ Object
readonly
Returns the value of attribute outputs.
Instance Method Summary collapse
- #add_output(name, value) ⇒ Object
-
#initialize ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize ⇒ Result
Returns a new instance of Result.
178 179 180 181 |
# File 'lib/lev/routine.rb', line 178 def initialize @outputs = {} @errors = Errors.new end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
176 177 178 |
# File 'lib/lev/routine.rb', line 176 def errors @errors end |
#outputs ⇒ Object (readonly)
Returns the value of attribute outputs.
175 176 177 |
# File 'lib/lev/routine.rb', line 175 def outputs @outputs end |
Instance Method Details
#add_output(name, value) ⇒ Object
183 184 185 186 |
# File 'lib/lev/routine.rb', line 183 def add_output(name, value) outputs[name] = [outputs[name], value].flatten.compact outputs[name] = outputs[name].first if outputs[name].size == 1 end |