Class: LoadPath::PathBuilder
- Inherits:
-
Object
- Object
- LoadPath::PathBuilder
- Defined in:
- lib/path_builder.rb
Overview
Builder for path helper
Instance Attribute Summary collapse
-
#path_helper ⇒ Object
Returns the value of attribute path_helper.
Instance Method Summary collapse
- #child_directory(*args) ⇒ Object
- #file_path(file_name = nil) ⇒ Object
-
#initialize(root_dir, expand_path = false) ⇒ PathBuilder
constructor
A new instance of PathBuilder.
- #parent_directory(*args) ⇒ Object
- #sibling_directory(*args) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(root_dir, expand_path = false) ⇒ PathBuilder
48 49 50 |
# File 'lib/path_builder.rb', line 48 def initialize(root_dir, =false) @path_helper = PathHelper.new(root_dir, ) end |
Instance Attribute Details
#path_helper ⇒ Object
Returns the value of attribute path_helper.
46 47 48 |
# File 'lib/path_builder.rb', line 46 def path_helper @path_helper end |
Instance Method Details
#child_directory(*args) ⇒ Object
57 58 59 60 |
# File 'lib/path_builder.rb', line 57 def child_directory(*args) @path_helper = PathHelper.new(@path_helper.child_directory(*args)) self end |
#file_path(file_name = nil) ⇒ Object
67 68 69 |
# File 'lib/path_builder.rb', line 67 def file_path(file_name=nil) @path_helper.file_path(file_name) end |
#parent_directory(*args) ⇒ Object
52 53 54 55 |
# File 'lib/path_builder.rb', line 52 def parent_directory(*args) @path_helper = PathHelper.new(@path_helper.parent_directory(*args)) self end |
#sibling_directory(*args) ⇒ Object
62 63 64 65 |
# File 'lib/path_builder.rb', line 62 def sibling_directory(*args) @path_helper = PathHelper.new(@path_helper.sibling_directory(*args)) self end |
#to_s ⇒ Object
71 72 73 |
# File 'lib/path_builder.rb', line 71 def to_s file_path end |