Module: Hipbot::Reactable
Instance Method Summary collapse
- #default(*params, &block) ⇒ Object
- #desc(text) ⇒ Object
- #on(*params, &block) ⇒ Object
- #on_presence(*params, &block) ⇒ Object
- #scope(*params, &block) ⇒ Object
Methods included from Cache
Instance Method Details
#default(*params, &block) ⇒ Object
22 23 24 25 26 |
# File 'lib/hipbot/reactable.rb', line 22 def default *params, &block scope *params do default_reactions << to_reaction(block) end end |
#desc(text) ⇒ Object
34 35 36 |
# File 'lib/hipbot/reactable.rb', line 34 def desc text reaction_factory.description(text) end |
#on(*params, &block) ⇒ Object
16 17 18 19 20 |
# File 'lib/hipbot/reactable.rb', line 16 def on *params, &block scope *params do reactions << to_reaction(block) end end |
#on_presence(*params, &block) ⇒ Object
10 11 12 13 14 |
# File 'lib/hipbot/reactable.rb', line 10 def on_presence *params, &block scope *params do presence_reactions << to_reaction(block) end end |
#scope(*params, &block) ⇒ Object
28 29 30 31 32 |
# File 'lib/hipbot/reactable.rb', line 28 def scope *params, &block << reaction_factory.(params) yield .pop end |