Class: ConsoleLog::Base
- Inherits:
-
Object
- Object
- ConsoleLog::Base
- Includes:
- Singleton
- Defined in:
- lib/console_log/base.rb
Instance Attribute Summary collapse
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
Instance Method Summary collapse
- #append(*messages) ⇒ Object
- #flush_queue ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #reset ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
9 10 11 |
# File 'lib/console_log/base.rb', line 9 def initialize reset end |
Instance Attribute Details
#queue ⇒ Object (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(*) @queue += end |
#flush_queue ⇒ Object
21 22 23 24 25 26 |
# File 'lib/console_log/base.rb', line 21 def flush_queue queue = @queue.dup @queue.clear queue end |
#reset ⇒ Object
13 14 15 |
# File 'lib/console_log/base.rb', line 13 def reset @queue = [] end |