module Ruboty::TrustMe

Constants

NAMESPACE
VERSION

Public Instance Methods

receive(attributes) click to toggle source
Calls superclass method
# File lib/ruboty/trust_me.rb, line 8
def receive(attributes)
  if trust?(attributes[:from_name] || attributes[:from])
    super
  end
end
trust?(from_name) click to toggle source
# File lib/ruboty/trust_me.rb, line 14
def trust?(from_name)
  trusted_names.include?(from_name) || trusted_names.empty? || from_name == name
end
trusted_names() click to toggle source
# File lib/ruboty/trust_me.rb, line 18
def trusted_names
  brain.data[::Ruboty::TrustMe::NAMESPACE] ||= []
end