Class: Conveyor::Output::Channel
- Inherits:
-
Object
- Object
- Conveyor::Output::Channel
- Includes:
- Singleton
- Defined in:
- lib/conveyor/output/channel.rb
Instance Method Summary collapse
-
#initialize ⇒ Channel
constructor
A new instance of Channel.
- #write(name, msgtype, *msg) ⇒ Object
Constructor Details
#initialize ⇒ Channel
Returns a new instance of Channel.
6 7 |
# File 'lib/conveyor/output/channel.rb', line 6 def initialize end |
Instance Method Details
#write(name, msgtype, *msg) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/conveyor/output/channel.rb', line 9 def write(name, msgtype, *msg) @channel = Conveyor::Foreman.instance.channel return false if @channel.nil? = msg. format = '[%s] [%s::%s] %s' Array.new(msg).each do |m| @channel.push [msgtype, sprintf(format, Time.now, name, msgtype, m)] end end |