Class: Fried::Test::Directory::CurrentWorkingDirectory
- Inherits:
-
Object
- Object
- Fried::Test::Directory::CurrentWorkingDirectory
- Defined in:
- lib/fried/test/directory/current_working_directory.rb
Defined Under Namespace
Classes: Substitute
Instance Attribute Summary collapse
-
#dir ⇒ Object
Returns the value of attribute dir.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#dir ⇒ Object
Returns the value of attribute dir.
23 24 25 |
# File 'lib/fried/test/directory/current_working_directory.rb', line 23 def dir @dir end |
Class Method Details
.build ⇒ Object
25 26 27 28 29 |
# File 'lib/fried/test/directory/current_working_directory.rb', line 25 def self.build new.tap do |instance| instance.dir = Dir end end |
.call ⇒ Object
39 40 41 42 |
# File 'lib/fried/test/directory/current_working_directory.rb', line 39 def self.call instance = build instance.() end |
Instance Method Details
#call ⇒ Pathname
32 33 34 35 36 37 |
# File 'lib/fried/test/directory/current_working_directory.rb', line 32 def call return Pathname.new("/dev/null") if dir.nil? path_as_text = dir.pwd Pathname.new(path_as_text) end |