Class: Testspace::Space
- Inherits:
-
Object
- Object
- Testspace::Space
- Defined in:
- lib/testspace/space.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
Instance Method Summary collapse
- #enter(&block) ⇒ Object
- #from ⇒ Object
-
#initialize(options = {}) ⇒ Space
constructor
A new instance of Space.
- #module ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Space
Returns a new instance of Space.
3 4 5 |
# File 'lib/testspace/space.rb', line 3 def initialize( = {}) @options = end |
Instance Attribute Details
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
7 8 9 |
# File 'lib/testspace/space.rb', line 7 def dir @dir end |
Instance Method Details
#enter(&block) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/testspace/space.rb', line 13 def enter(&block) ::Dir.mktmpdir do |dir| @dir = dir block.call end end |
#from ⇒ Object
30 31 32 |
# File 'lib/testspace/space.rb', line 30 def from @from ||= @options[:from] end |