Module: Hipbot::Reactable

Includes:
Cache
Included in:
Bot
Defined in:
lib/hipbot/reactable.rb

Instance Method Summary collapse

Methods included from Cache

#_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
  options_stack << reaction_factory.get_reaction_options(params)
  yield
  options_stack.pop
end