Module: HrLite::MentionParser
- Defined in:
- lib/hr_lite/mention_parser.rb
Overview
Kudos messages carry mentions as visible plain-text markers:
"Great save @[Asha Rao](42) during the outage"
The picker inserts them; this parser extracts the ids server-side.
Constant Summary collapse
- MARKER =
/@\[([^\]\n]{1,80})\]\((\d+)\)/- LIMIT =
notification-spam cap
10
Class Method Summary collapse
-
.strip_markers(text) ⇒ Object
Bell/email bodies show "@Asha Rao", never the raw marker.
- .user_ids(text) ⇒ Object
Class Method Details
.strip_markers(text) ⇒ Object
Bell/email bodies show "@Asha Rao", never the raw marker.
14 15 16 |
# File 'lib/hr_lite/mention_parser.rb', line 14 def self.strip_markers(text) text.to_s.gsub(MARKER) { "@#{Regexp.last_match(1)}" } end |