Class: Lita::Adapters::Slack::UserCreator Private

Inherits:
Object
  • Object
show all
Defined in:
lib/lita/adapters/slack/user_creator.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Class Method Details

.create_user(slack_user, robot, robot_id) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
10
11
12
13
14
15
16
# File 'lib/lita/adapters/slack/user_creator.rb', line 7

def create_user(slack_user, robot, robot_id)
  User.create(
    slack_user.id,
    name: real_name(slack_user),
    mention_name: slack_user.name
  )

  update_robot(robot, slack_user) if slack_user.id == robot_id
  robot.trigger(:slack_user_created, slack_user: slack_user)
end

.create_users(slack_users, robot, robot_id) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



18
19
20
# File 'lib/lita/adapters/slack/user_creator.rb', line 18

def create_users(slack_users, robot, robot_id)
  slack_users.each { |slack_user| create_user(slack_user, robot, robot_id) }
end