Class: Hipbot::Match

Inherits:
Struct
  • Object
show all
Includes:
Cache
Defined in:
lib/hipbot/match.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Cache

#_cache

Instance Attribute Details

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



2
3
4
# File 'lib/hipbot/match.rb', line 2

def message
  @message
end

#reactionObject

Returns the value of attribute reaction

Returns:

  • (Object)

    the current value of reaction



2
3
4
# File 'lib/hipbot/match.rb', line 2

def reaction
  @reaction
end

Class Method Details

.invoke_all(matches) ⇒ Object



55
56
57
# File 'lib/hipbot/match.rb', line 55

def invoke_all matches
  matches.each(&:invoke)
end

Instance Method Details

#invokeObject



9
10
11
# File 'lib/hipbot/match.rb', line 9

def invoke
  Response.new(reaction, message).invoke(reaction_parameters)
end

#matches?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/hipbot/match.rb', line 5

def matches?
  matches_scope? && matches_place? && matches_regexp? && matches_sender? && matches_condition?
end