Class: ConsoleLog::Base

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/console_log/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



9
10
11
# File 'lib/console_log/base.rb', line 9

def initialize
  reset
end

Instance Attribute Details

#queueObject (readonly)

Returns the value of attribute queue.



7
8
9
# File 'lib/console_log/base.rb', line 7

def queue
  @queue
end

Instance Method Details

#append(*messages) ⇒ Object



17
18
19
# File 'lib/console_log/base.rb', line 17

def append(*messages)
  @queue += messages
end

#flush_queueObject



21
22
23
24
25
26
# File 'lib/console_log/base.rb', line 21

def flush_queue
  queue = @queue.dup
  @queue.clear

  queue
end

#resetObject



13
14
15
# File 'lib/console_log/base.rb', line 13

def reset
  @queue = []
end