Class: Rails::Paths::Root
- Inherits:
-
Object
- Object
- Rails::Paths::Root
show all
- Includes:
- PathParent
- Defined in:
- lib/rails/paths.rb
Instance Attribute Summary collapse
Attributes included from PathParent
#children
Instance Method Summary
collapse
Methods included from PathParent
#method_missing
Constructor Details
#initialize(path) ⇒ Root
Returns a new instance of Root.
26
27
28
29
30
31
32
|
# File 'lib/rails/paths.rb', line 26
def initialize(path)
raise if path.is_a?(Array)
@children = {}
@path = path
@root = self
@all_paths = []
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Rails::Paths::PathParent
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
24
25
26
|
# File 'lib/rails/paths.rb', line 24
def path
@path
end
|
Instance Method Details
#all_paths ⇒ Object
34
35
36
37
|
# File 'lib/rails/paths.rb', line 34
def all_paths
@all_paths.uniq!
@all_paths
end
|
#autoload_once ⇒ Object
39
40
41
|
# File 'lib/rails/paths.rb', line 39
def autoload_once
filter_by(:autoload_once?)
end
|
#autoload_paths ⇒ Object
47
48
49
|
# File 'lib/rails/paths.rb', line 47
def autoload_paths
filter_by(:autoload?)
end
|
#eager_load ⇒ Object
43
44
45
|
# File 'lib/rails/paths.rb', line 43
def eager_load
filter_by(:eager_load?)
end
|
#load_paths ⇒ Object
51
52
53
|
# File 'lib/rails/paths.rb', line 51
def load_paths
filter_by(:load_path?)
end
|
#push ⇒ Object
Also known as:
unshift, <<, concat
55
56
57
|
# File 'lib/rails/paths.rb', line 55
def push(*)
raise "Application root can only have one physical path"
end
|