Class: Shanty::Mutator
- Inherits:
-
Object
- Object
- Shanty::Mutator
- Defined in:
- lib/shanty/mutator.rb
Overview
Public: enables mutation of the project graph Common usage would be to set changed flags on projects
Direct Known Subclasses
Class Attribute Summary collapse
-
.mutators ⇒ Object
readonly
Returns the value of attribute mutators.
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
Class Method Summary collapse
Instance Method Summary collapse
- #apply_mutations ⇒ Object
-
#initialize(env, graph) ⇒ Mutator
constructor
A new instance of Mutator.
Constructor Details
#initialize(env, graph) ⇒ Mutator
Returns a new instance of Mutator.
13 14 15 16 |
# File 'lib/shanty/mutator.rb', line 13 def initialize(env, graph) @env = env @graph = graph end |
Class Attribute Details
.mutators ⇒ Object (readonly)
Returns the value of attribute mutators.
8 9 10 |
# File 'lib/shanty/mutator.rb', line 8 def mutators @mutators end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
11 12 13 |
# File 'lib/shanty/mutator.rb', line 11 def env @env end |
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
11 12 13 |
# File 'lib/shanty/mutator.rb', line 11 def graph @graph end |
Class Method Details
Instance Method Details
#apply_mutations ⇒ Object
24 25 26 27 28 |
# File 'lib/shanty/mutator.rb', line 24 def apply_mutations self.class.mutators.each do |mutator| mutator.new(@env, @graph).mutate end end |