Class: Console::Output::Wrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/console/output/wrapper.rb

Overview

A generic wrapper for output handling.

Direct Known Subclasses

Failure, Sensitive

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delegate, **options) ⇒ Wrapper

Create a new wrapper output.



14
15
16
# File 'lib/console/output/wrapper.rb', line 14

def initialize(delegate, **options)
	@delegate = delegate
end

Instance Attribute Details

#delegateObject (readonly)

Returns the value of attribute delegate.



19
20
21
# File 'lib/console/output/wrapper.rb', line 19

def delegate
  @delegate
end

Instance Method Details

#callObject

Invoke the delegate.



34
35
36
# File 'lib/console/output/wrapper.rb', line 34

def call(...)
	@delegate.call(...)
end

#last_outputObject

The last output is the last output of the delegate.



22
23
24
# File 'lib/console/output/wrapper.rb', line 22

def last_output
	@delegate.last_output
end

#The output to delegate to.=(outputtodelegateto. = (value)) ⇒ Object



19
# File 'lib/console/output/wrapper.rb', line 19

attr :delegate

#verbose!(value = true) ⇒ Object

Set the verbose flag for the delegate.



29
30
31
# File 'lib/console/output/wrapper.rb', line 29

def verbose!(value = true)
	@delegate.verbose!(value)
end