Class: Interscript::Node::Rule::Run
- Inherits:
-
Interscript::Node::Rule
- Object
- Interscript::Node
- Interscript::Node::Rule
- Interscript::Node::Rule::Run
- Defined in:
- lib/interscript/node/rule/run.rb
Instance Attribute Summary collapse
-
#reverse_run ⇒ Object
Returns the value of attribute reverse_run.
-
#stage ⇒ Object
Returns the value of attribute stage.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(stage, reverse_run: nil) ⇒ Run
constructor
A new instance of Run.
- #inspect ⇒ Object
- #reverse ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(stage, reverse_run: nil) ⇒ Run
Returns a new instance of Run.
3 4 5 6 |
# File 'lib/interscript/node/rule/run.rb', line 3 def initialize stage, reverse_run: nil @stage = stage @reverse_run = reverse_run end |
Instance Attribute Details
#reverse_run ⇒ Object
Returns the value of attribute reverse_run.
2 3 4 |
# File 'lib/interscript/node/rule/run.rb', line 2 def reverse_run @reverse_run end |
#stage ⇒ Object
Returns the value of attribute stage.
2 3 4 |
# File 'lib/interscript/node/rule/run.rb', line 2 def stage @stage end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 |
# File 'lib/interscript/node/rule/run.rb', line 19 def ==(other) super && self.stage == other.stage end |
#inspect ⇒ Object
23 24 25 26 27 |
# File 'lib/interscript/node/rule/run.rb', line 23 def inspect out = "run #{@stage.inspect}" out += ", reverse_run: #{@reverse_run.inspect}" unless reverse_run.nil? out end |
#reverse ⇒ Object
13 14 15 16 17 |
# File 'lib/interscript/node/rule/run.rb', line 13 def reverse Interscript::Node::Rule::Run.new(stage, reverse_run: reverse_run.nil? ? nil : !reverse_run ) end |
#to_hash ⇒ Object
8 9 10 11 |
# File 'lib/interscript/node/rule/run.rb', line 8 def to_hash { :class => self.class.to_s, :stage => self.stage.to_hash } end |