Module: RoboPigeon::Dsl::Helpers::Slack

Included in:
RoboPigeon::Dsl::Helpers
Defined in:
lib/robopigeon/slack/helper_dsl.rb

Instance Method Summary collapse

Instance Method Details

#slack_name_for(*search) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/robopigeon/slack/helper_dsl.rb', line 13

def slack_name_for(*search)
  uid = RoboPigeon::Slack::Client.get_user(search).try(:name)

  return '' if uid.nil?

  "@#{uid}"
end

#slack_user_for(*search) ⇒ Object



5
6
7
8
9
10
# File 'lib/robopigeon/slack/helper_dsl.rb', line 5

def slack_user_for(*search)
  uid = RoboPigeon::Slack::Client.get_user(search).try(:id)
  return '' if uid.nil?

  "<@#{uid}>"
end

#slack_user_group(id) ⇒ Object



22
23
24
# File 'lib/robopigeon/slack/helper_dsl.rb', line 22

def slack_user_group(id)
  "<!subteam^#{id}>"
end