Class: Console::Output::Wrapper
- Inherits:
-
Object
- Object
- Console::Output::Wrapper
- Defined in:
- lib/console/output/wrapper.rb
Overview
A generic wrapper for output handling.
Instance Attribute Summary collapse
-
#delegate ⇒ Object
readonly
Returns the value of attribute delegate.
Instance Method Summary collapse
-
#call ⇒ Object
Invoke the delegate.
-
#initialize(delegate, **options) ⇒ Wrapper
constructor
Create a new wrapper output.
-
#last_output ⇒ Object
The last output is the last output of the delegate.
- #The output to delegate to.=(outputtodelegateto. = (value)) ⇒ Object
-
#verbose!(value = true) ⇒ Object
Set the verbose flag for the delegate.
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, **) @delegate = delegate end |
Instance Attribute Details
#delegate ⇒ Object (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
#call ⇒ Object
Invoke the delegate.
34 35 36 |
# File 'lib/console/output/wrapper.rb', line 34 def call(...) @delegate.call(...) end |
#last_output ⇒ Object
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 |