Module: StatusHelper::Utility

Included in:
Lita::Handlers::Status
Defined in:
lib/status_helper/utility.rb

Instance Method Summary collapse

Instance Method Details

#find_user(user, search_method = :find_by_mention_name) ⇒ Object

Find Lita::User by particular method Returns nil if it finds nothing



5
6
7
8
9
# File 'lib/status_helper/utility.rb', line 5

def find_user(user, search_method = :find_by_mention_name)
  method_obj = Lita::User.method search_method
  found_user = method_obj.call user
  found_user
end