Class: Ruboty::TrustMe::Actions::DontTrust

Inherits:
Actions::Base
  • Object
show all
Defined in:
lib/ruboty/trust_me/actions/dont_trust.rb

Instance Method Summary collapse

Instance Method Details

#callObject



5
6
7
8
9
10
11
12
13
# File 'lib/ruboty/trust_me/actions/dont_trust.rb', line 5

def call
  if message[:name]
    message.robot.trusted_names.delete_if {|n| n == message[:name] }
    message.reply(%(I don't trust #{message[:name]}.))
  else
    message.robot.trusted_names.delete_if {|n| n == message.from_name }
    message.reply(%(I don't trust you.))
  end
end