Class: Rake::NameSpace
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rake/name_space.rb |
Overview
The NameSpace class will lookup task names in the scope defined by a namespace
command.
Class Method Summary
-
.new(task_manager, scope_list) ⇒ NameSpace
constructor
Create a namespace lookup object using the given task manager and the list of scopes.
Instance Method Summary
-
#[](name)
Lookup a task named
name
in the namespace. -
#scope
The scope of the namespace (a LinkedList).
-
#tasks
Return the list of tasks defined in this and nested namespaces.
Constructor Details
.new(task_manager, scope_list) ⇒ NameSpace
Create a namespace lookup object using the given task manager and the list of scopes.
# File 'lib/rake/name_space.rb', line 11
def initialize(task_manager, scope_list) @task_manager = task_manager @scope = scope_list.dup end
Instance Method Details
#[](name)
Lookup a task named name
in the namespace.
# File 'lib/rake/name_space.rb', line 19
def [](name) @task_manager.lookup(name, @scope) end
#scope
The scope of the namespace (a LinkedList)
# File 'lib/rake/name_space.rb', line 26
def scope @scope.dup end
#tasks
Return the list of tasks defined in this and nested namespaces.
# File 'lib/rake/name_space.rb', line 33
def tasks @task_manager.tasks_in_scope(@scope) end