Class: ChefDK::UI
- Inherits:
-
Object
- Object
- ChefDK::UI
- Defined in:
- lib/chef-dk/ui.rb
Defined Under Namespace
Classes: NullStream
Instance Attribute Summary collapse
-
#err_stream ⇒ Object
readonly
Returns the value of attribute err_stream.
-
#out_stream ⇒ Object
readonly
Returns the value of attribute out_stream.
Class Method Summary collapse
Instance Method Summary collapse
- #err(message) ⇒ Object
-
#initialize(out: nil, err: nil) ⇒ UI
constructor
A new instance of UI.
- #msg(message) ⇒ Object
Constructor Details
#initialize(out: nil, err: nil) ⇒ UI
Returns a new instance of UI.
36 37 38 39 |
# File 'lib/chef-dk/ui.rb', line 36 def initialize(out: nil, err: nil) @out_stream = out || $stdout @err_stream = err || $stderr end |
Instance Attribute Details
#err_stream ⇒ Object (readonly)
Returns the value of attribute err_stream.
34 35 36 |
# File 'lib/chef-dk/ui.rb', line 34 def err_stream @err_stream end |
#out_stream ⇒ Object (readonly)
Returns the value of attribute out_stream.
33 34 35 |
# File 'lib/chef-dk/ui.rb', line 33 def out_stream @out_stream end |
Class Method Details
.null ⇒ Object
29 30 31 |
# File 'lib/chef-dk/ui.rb', line 29 def self.null new(out: NullStream.new, err: NullStream.new) end |
Instance Method Details
#err(message) ⇒ Object
41 42 43 |
# File 'lib/chef-dk/ui.rb', line 41 def err() @err_stream.puts() end |
#msg(message) ⇒ Object
45 46 47 |
# File 'lib/chef-dk/ui.rb', line 45 def msg() @out_stream.puts() end |