Class: LoadPath::PathBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/path_builder.rb

Overview

Builder for path helper

Instance Attribute Summary collapse

Instance Method Summary collapse

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, expand_path=false)
  @path_helper = PathHelper.new(root_dir, expand_path)
end

Instance Attribute Details

#path_helperObject

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_sObject



70
71
72
# File 'lib/path_builder.rb', line 70

def to_s
  file_path
end