Class: Gekko::Tape
- Inherits:
-
Object
- Object
- Gekko::Tape
- Defined in:
- lib/gekko/tape.rb
Overview
Records the trading engine messages sequentially
Instance Attribute Summary collapse
-
#events ⇒ Object
Returns the value of attribute events.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#<<(message) ⇒ Object
Prints a message on the tape.
-
#initialize(logger = nil) ⇒ Tape
constructor
A new instance of Tape.
Constructor Details
#initialize(logger = nil) ⇒ Tape
Returns a new instance of Tape.
10 11 12 13 |
# File 'lib/gekko/tape.rb', line 10 def initialize(logger = nil) @events = [] @logger = logger end |
Instance Attribute Details
#events ⇒ Object
Returns the value of attribute events.
8 9 10 |
# File 'lib/gekko/tape.rb', line 8 def events @events end |
#logger ⇒ Object
Returns the value of attribute logger.
8 9 10 |
# File 'lib/gekko/tape.rb', line 8 def logger @logger end |
Instance Method Details
#<<(message) ⇒ Object
Prints a message on the tape
20 21 22 23 24 |
# File 'lib/gekko/tape.rb', line 20 def <<() [:sequence] = events.length logger && logger.info() events << end |