Class: Rtml::ReverseEngineering::Simulator::Snapshot
- Inherits:
-
Object
- Object
- Rtml::ReverseEngineering::Simulator::Snapshot
- Defined in:
- lib/rtml/reverse_engineering/simulator/snapshot.rb
Overview
This class is used to contain a single screen
element (an instance of Hpricot::Elem) as well as any variable assignments that have been made. Basically, it is simply used by Rtml::ReverseEngineering::Simulator
to check for circular pathways. If two identical snapshots would be created, then it stands to reason that the resultant pathways for those two snapshots will also be identical. If you’re following a path and creating snapshots at every step of the way, and two snapshots match, then using that logic, those two snapshots would indicate a circular pathway. (It comes down to either that, or waiting to catch a stack overflow error, which is less than optimal.)
Instance Attribute Summary collapse
-
#screen ⇒ Object
readonly
Returns the value of attribute screen.
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
Instance Method Summary collapse
- #==(other_snapshot) ⇒ Object
-
#initialize(screen, variables) ⇒ Snapshot
constructor
A new instance of Snapshot.
Constructor Details
#initialize(screen, variables) ⇒ Snapshot
Returns a new instance of Snapshot.
11 12 13 |
# File 'lib/rtml/reverse_engineering/simulator/snapshot.rb', line 11 def initialize(screen, variables) @screen, @variables = screen, variables.dup end |
Instance Attribute Details
#screen ⇒ Object (readonly)
Returns the value of attribute screen.
9 10 11 |
# File 'lib/rtml/reverse_engineering/simulator/snapshot.rb', line 9 def screen @screen end |
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
9 10 11 |
# File 'lib/rtml/reverse_engineering/simulator/snapshot.rb', line 9 def variables @variables end |
Instance Method Details
#==(other_snapshot) ⇒ Object
15 16 17 |
# File 'lib/rtml/reverse_engineering/simulator/snapshot.rb', line 15 def ==(other_snapshot) @screen == other_snapshot.screen && variables == other_snapshot.variables end |