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



48
49
50
# File 'lib/path_builder.rb', line 48

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.



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_sObject



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

def to_s
  file_path
end