Class: Zeusd::LastLineArray
- Inherits:
-
Object
- Object
- Zeusd::LastLineArray
- Extended by:
- Forwardable
- Defined in:
- lib/zeusd/log/last_line_array.rb
Instance Method Summary collapse
- #<<(line) ⇒ Object
-
#initialize(*args) ⇒ LastLineArray
constructor
A new instance of LastLineArray.
- #to_a ⇒ Object
Constructor Details
#initialize(*args) ⇒ LastLineArray
Returns a new instance of LastLineArray.
8 9 10 |
# File 'lib/zeusd/log/last_line_array.rb', line 8 def initialize(*args) @hash = Hash[args.zip(args)] end |
Instance Method Details
#<<(line) ⇒ Object
12 13 14 |
# File 'lib/zeusd/log/last_line_array.rb', line 12 def <<(line) @hash[line.id] = line end |
#to_a ⇒ Object
16 17 18 |
# File 'lib/zeusd/log/last_line_array.rb', line 16 def to_a @hash.values end |