Class: Bot::ResponderChain
- Inherits:
-
Object
- Object
- Bot::ResponderChain
- Defined in:
- lib/bot/responder_chain.rb
Instance Method Summary collapse
- #add(responder) ⇒ Object
-
#initialize ⇒ ResponderChain
constructor
A new instance of ResponderChain.
- #responders ⇒ Object
Constructor Details
#initialize ⇒ ResponderChain
Returns a new instance of ResponderChain.
3 4 5 |
# File 'lib/bot/responder_chain.rb', line 3 def initialize @responders = [] end |
Instance Method Details
#add(responder) ⇒ Object
7 8 9 |
# File 'lib/bot/responder_chain.rb', line 7 def add(responder) @responders += Array.wrap(responder) end |
#responders ⇒ Object
11 12 13 |
# File 'lib/bot/responder_chain.rb', line 11 def responders @responders.map {|r| r.to_s.constantize } end |