Class: XSpec::NestedUnitOfWork
- Inherits:
-
Struct
- Object
- Struct
- XSpec::NestedUnitOfWork
- Defined in:
- lib/xspec/data_structures.rb
Overview
Units of work can be nested inside contexts. This is the main object that other components of the system work with.
Instance Attribute Summary collapse
-
#parents ⇒ Object
Returns the value of attribute parents.
-
#unit_of_work ⇒ Object
Returns the value of attribute unit_of_work.
Instance Method Summary collapse
Instance Attribute Details
#parents ⇒ Object
Returns the value of attribute parents
155 156 157 |
# File 'lib/xspec/data_structures.rb', line 155 def parents @parents end |
#unit_of_work ⇒ Object
Returns the value of attribute unit_of_work
155 156 157 |
# File 'lib/xspec/data_structures.rb', line 155 def unit_of_work @unit_of_work end |
Instance Method Details
#block ⇒ Object
156 |
# File 'lib/xspec/data_structures.rb', line 156 def block; unit_of_work.block; end |
#immediate_parent ⇒ Object
159 160 161 |
# File 'lib/xspec/data_structures.rb', line 159 def immediate_parent parents.last end |
#name ⇒ Object
157 |
# File 'lib/xspec/data_structures.rb', line 157 def name; unit_of_work.name; end |
#nest_under(parent) ⇒ Object
163 164 165 |
# File 'lib/xspec/data_structures.rb', line 163 def nest_under(parent) self.class.new([parent] + parents, unit_of_work) end |