Class: Build::TargetNode

Inherits:
Graph::Node
  • Object
show all
Defined in:
lib/build/controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task_class, &update) ⇒ TargetNode

Returns a new instance of TargetNode.



66
67
68
69
70
71
# File 'lib/build/controller.rb', line 66

def initialize(task_class, &update)
  @update = update
  @task_class = task_class
  
  super(Files::Paths::NONE, :inherit, @update)
end

Instance Attribute Details

#task_classObject (readonly)

Returns the value of attribute task_class.



73
74
75
# File 'lib/build/controller.rb', line 73

def task_class
  @task_class
end

Instance Method Details

#apply!(scope) ⇒ Object



75
76
77
# File 'lib/build/controller.rb', line 75

def apply!(scope)
  scope.instance_exec(&@update)
end

#inspectObject



79
80
81
# File 'lib/build/controller.rb', line 79

def inspect
  @task_class.name.inspect
end