Class: GreenPepper::ExecutionUnit
- Inherits:
-
Object
- Object
- GreenPepper::ExecutionUnit
- Defined in:
- lib/greenpepper/executionunit.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Raw HTML content.
-
#context ⇒ Object
Raw HTML content.
-
#example ⇒ Object
Raw HTML content.
-
#result ⇒ Object
Raw HTML content.
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(content, context, example = nil, result = nil) ⇒ ExecutionUnit
constructor
A new instance of ExecutionUnit.
Constructor Details
#initialize(content, context, example = nil, result = nil) ⇒ ExecutionUnit
Returns a new instance of ExecutionUnit.
14 15 16 17 18 19 |
# File 'lib/greenpepper/executionunit.rb', line 14 def initialize(content, context, example = nil, result = nil) @content = content @context = context @example = example @result = result end |
Instance Attribute Details
#content ⇒ Object
Raw HTML content
9 10 11 |
# File 'lib/greenpepper/executionunit.rb', line 9 def content @content end |
#context ⇒ Object
Raw HTML content
9 10 11 |
# File 'lib/greenpepper/executionunit.rb', line 9 def context @context end |
#example ⇒ Object
Raw HTML content
9 10 11 |
# File 'lib/greenpepper/executionunit.rb', line 9 def example @example end |
#result ⇒ Object
Raw HTML content
9 10 11 |
# File 'lib/greenpepper/executionunit.rb', line 9 def result @result end |
Class Method Details
.content_list(execution_units) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/greenpepper/executionunit.rb', line 32 def self.content_list(execution_units) contents = [] execution_units.each {|ex_unit| contents << ex_unit.content} contents end |
.result_list(execution_units) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/greenpepper/executionunit.rb', line 25 def self.result_list(execution_units) result_list = [] execution_units.each {|ex_unit| result_list << ex_unit.result} result_list end |
Instance Method Details
#execute ⇒ Object
21 22 23 |
# File 'lib/greenpepper/executionunit.rb', line 21 def execute @result = example.execute end |