Class: Build::RuleNode
- Inherits:
-
Graph::Node
- Object
- Graph::Node
- Build::RuleNode
- Defined in:
- lib/build/controller.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#callback ⇒ Object
readonly
Returns the value of attribute callback.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
Instance Method Summary collapse
- #apply!(scope) ⇒ Object
-
#initialize(rule, arguments, &block) ⇒ RuleNode
constructor
A new instance of RuleNode.
- #inspect ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(rule, arguments, &block) ⇒ RuleNode
Returns a new instance of RuleNode.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/build/controller.rb', line 34 def initialize(rule, arguments, &block) @arguments = arguments @rule = rule @callback = block inputs, outputs = @rule.files(@arguments) super(inputs, outputs, @rule) end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
45 46 47 |
# File 'lib/build/controller.rb', line 45 def arguments @arguments end |
#callback ⇒ Object (readonly)
Returns the value of attribute callback.
47 48 49 |
# File 'lib/build/controller.rb', line 47 def callback @callback end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
46 47 48 |
# File 'lib/build/controller.rb', line 46 def rule @rule end |
Instance Method Details
#apply!(scope) ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/build/controller.rb', line 53 def apply!(scope) @rule.apply!(scope, @arguments) if @callback scope.instance_exec(@arguments, &@callback) end end |
#inspect ⇒ Object
61 62 63 |
# File 'lib/build/controller.rb', line 61 def inspect @rule.name.inspect end |
#title ⇒ Object
49 50 51 |
# File 'lib/build/controller.rb', line 49 def title @rule.title end |