Class: Toast::TestChannel
Instance Attribute Summary collapse
-
#output ⇒ Object
Returns the value of attribute output.
Attributes inherited from Channel
Instance Method Summary collapse
-
#initialize(responder_class) ⇒ TestChannel
constructor
A new instance of TestChannel.
- #run(script) ⇒ Object
- #send(msg, to) ⇒ Object
Methods inherited from Channel
#handle, #next_msg, #responder_for
Constructor Details
#initialize(responder_class) ⇒ TestChannel
Returns a new instance of TestChannel.
5 6 7 8 |
# File 'lib/test_channel.rb', line 5 def initialize responder_class super responder_class self.output=[] end |
Instance Attribute Details
#output ⇒ Object
Returns the value of attribute output.
3 4 5 |
# File 'lib/test_channel.rb', line 3 def output @output end |
Instance Method Details
#run(script) ⇒ Object
14 15 16 17 18 |
# File 'lib/test_channel.rb', line 14 def run script script.each do |text| handle Message.new(text,'test@localhost') end end |
#send(msg, to) ⇒ Object
10 11 12 |
# File 'lib/test_channel.rb', line 10 def send msg,to @output << Message.new(msg,to) end |