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
Returns a new instance of PathBuilder.
47 48 49 |
# File 'lib/path_builder.rb', line 47 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.
45 46 47 |
# File 'lib/path_builder.rb', line 45 def path_helper @path_helper end |
Instance Method Details
#child_directory(*args) ⇒ Object
56 57 58 59 |
# File 'lib/path_builder.rb', line 56 def child_directory(*args) @path_helper = PathHelper.new(@path_helper.child_directory(*args)) self end |
#file_path(file_name = nil) ⇒ Object
66 67 68 |
# File 'lib/path_builder.rb', line 66 def file_path(file_name=nil) @path_helper.file_path(file_name) end |
#parent_directory(*args) ⇒ Object
51 52 53 54 |
# File 'lib/path_builder.rb', line 51 def parent_directory(*args) @path_helper = PathHelper.new(@path_helper.parent_directory(*args)) self end |
#sibling_directory(*args) ⇒ Object
61 62 63 64 |
# File 'lib/path_builder.rb', line 61 def sibling_directory(*args) @path_helper = PathHelper.new(@path_helper.sibling_directory(*args)) self end |
#to_s ⇒ Object
70 71 72 |
# File 'lib/path_builder.rb', line 70 def to_s file_path end |