Class: Build::TargetNode
- Inherits:
-
Graph::Node
- Object
- Graph::Node
- Build::TargetNode
- Defined in:
- lib/build/target_node.rb
Instance Attribute Summary collapse
-
#task_class ⇒ Object
readonly
Returns the value of attribute task_class.
Instance Method Summary collapse
- #apply!(scope) ⇒ Object
-
#initialize(task_class, target) ⇒ TargetNode
constructor
A new instance of TargetNode.
- #inspect ⇒ Object
- #name ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(task_class, target) ⇒ TargetNode
Returns a new instance of TargetNode.
26 27 28 29 30 31 32 |
# File 'lib/build/target_node.rb', line 26 def initialize(task_class, target) @target = target @task_class = task_class # Wait here, for all dependent targets, to be done: super(Files::List::NONE, :inherit, target) end |
Instance Attribute Details
#task_class ⇒ Object (readonly)
Returns the value of attribute task_class.
34 35 36 |
# File 'lib/build/target_node.rb', line 34 def task_class @task_class end |
Instance Method Details
#apply!(scope) ⇒ Object
40 41 42 |
# File 'lib/build/target_node.rb', line 40 def apply!(scope) scope.instance_exec(&@target.build) end |
#inspect ⇒ Object
44 45 46 |
# File 'lib/build/target_node.rb', line 44 def inspect @task_class.name.inspect end |
#name ⇒ Object
36 37 38 |
# File 'lib/build/target_node.rb', line 36 def name @task_class.name end |
#to_s ⇒ Object
48 49 50 |
# File 'lib/build/target_node.rb', line 48 def to_s "#<#{self.class} #{@target.name}>" end |