Class: Zeusd::LastLineArray

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/zeusd/log/last_line_array.rb

Instance Method Summary collapse

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_aObject



16
17
18
# File 'lib/zeusd/log/last_line_array.rb', line 16

def to_a
  @hash.values
end