Class: Bot::ResponderChain

Inherits:
Object
  • Object
show all
Defined in:
lib/bot/responder_chain.rb

Instance Method Summary collapse

Constructor Details

#initializeResponderChain

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

#respondersObject



11
12
13
# File 'lib/bot/responder_chain.rb', line 11

def responders
  @responders.map {|r| r.to_s.constantize }
end