Class: Chef::EventDispatch::EventsOutputStream
- Inherits:
-
Object
- Object
- Chef::EventDispatch::EventsOutputStream
- Defined in:
- lib/chef/event_dispatch/events_output_stream.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #<<(str) ⇒ Object
- #close ⇒ Object
-
#initialize(events, options = {}) ⇒ EventsOutputStream
constructor
This is a fake stream that connects to events.
- #print(str) ⇒ Object
- #write(str) ⇒ Object
Constructor Details
#initialize(events, options = {}) ⇒ EventsOutputStream
This is a fake stream that connects to events.
Arguments
events: the EventDispatch object to send data to (run_context.events) options is a hash with these possible options:
-
name: a string that identifies the stream to the user. Preferably short.
11 12 13 14 15 |
# File 'lib/chef/event_dispatch/events_output_stream.rb', line 11 def initialize(events, = {}) @events = events @options = events.stream_opened(self, ) end |
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events.
18 19 20 |
# File 'lib/chef/event_dispatch/events_output_stream.rb', line 18 def events @events end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
17 18 19 |
# File 'lib/chef/event_dispatch/events_output_stream.rb', line 17 def @options end |
Instance Method Details
#<<(str) ⇒ Object
24 25 26 |
# File 'lib/chef/event_dispatch/events_output_stream.rb', line 24 def <<(str) events.stream_output(self, str, ) end |
#close ⇒ Object
32 33 34 |
# File 'lib/chef/event_dispatch/events_output_stream.rb', line 32 def close events.stream_closed(self, ) end |
#print(str) ⇒ Object
20 21 22 |
# File 'lib/chef/event_dispatch/events_output_stream.rb', line 20 def print(str) events.stream_output(self, str, ) end |
#write(str) ⇒ Object
28 29 30 |
# File 'lib/chef/event_dispatch/events_output_stream.rb', line 28 def write(str) events.stream_output(self, str, ) end |