Class: Hipbot::ReactionFactory
- Inherits:
-
Struct
- Object
- Struct
- Hipbot::ReactionFactory
- Defined in:
- lib/hipbot/reaction_factory.rb
Instance Attribute Summary collapse
-
#reactable ⇒ Object
writeonly
Sets the attribute reactable.
Instance Method Summary collapse
- #build(options_stack, block) ⇒ Object
- #description(text) ⇒ Object
- #get_reaction_options(params) ⇒ Object
Instance Attribute Details
#reactable=(value) ⇒ Object
Sets the attribute reactable
2 3 4 |
# File 'lib/hipbot/reaction_factory.rb', line 2 def reactable=(value) @reactable = value end |
Instance Method Details
#build(options_stack, block) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/hipbot/reaction_factory.rb', line 6 def build(, block) = () block ||= .delete(:block) @current_description = nil Reaction.new(reactable, , block) end |
#description(text) ⇒ Object
13 14 15 |
# File 'lib/hipbot/reaction_factory.rb', line 13 def description(text) @current_description = text end |
#get_reaction_options(params) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/hipbot/reaction_factory.rb', line 17 def (params) = params. get_reaction_method_proc(params) do |block| [:block] = block end [:regexps] = params if params.any? .merge(desc: current_description) end |