Class: Fudge::WithDirectory
- Inherits:
-
Object
- Object
- Fudge::WithDirectory
- Defined in:
- lib/fudge/with_directory.rb
Overview
Directory helpers methods
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
Instance Method Summary collapse
-
#initialize(dir, formatter) ⇒ WithDirectory
constructor
A new instance of WithDirectory.
-
#inside ⇒ Object
Executes a block inside the directory.
Constructor Details
#initialize(dir, formatter) ⇒ WithDirectory
5 6 7 8 |
# File 'lib/fudge/with_directory.rb', line 5 def initialize(dir, formatter) @dir = dir @formatter = formatter end |
Instance Attribute Details
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
3 4 5 |
# File 'lib/fudge/with_directory.rb', line 3 def dir @dir end |
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
3 4 5 |
# File 'lib/fudge/with_directory.rb', line 3 def formatter @formatter end |
Instance Method Details
#inside ⇒ Object
Executes a block inside the directory
11 12 13 14 15 16 |
# File 'lib/fudge/with_directory.rb', line 11 def inside Dir.chdir(dir) do yield end end |