Class: Qiita::Team::Services::Hooks::HipchatV1
- Defined in:
- lib/qiita/team/services/hooks/hipchat_v1.rb
Constant Summary collapse
- AVAILABLE_COLORS =
%w(yellow red green purple random).freeze
Class Method Summary collapse
Instance Method Summary collapse
- #item_became_coediting(event) ⇒ void
- #item_comment_created(event) ⇒ void
- #item_created(event) ⇒ void
- #item_updated(event) ⇒ void
- #ping ⇒ void
- #project_activated(event) ⇒ void
- #project_archived(event) ⇒ void
- #project_comment_created(event) ⇒ void
- #project_created(event) ⇒ void
- #project_updated(event) ⇒ void
- #team_member_added(event) ⇒ void
Methods inherited from Base
human_attribute_name, render_form
Methods included from Concerns::Service
Methods included from Concerns::Persistable
#initialize, #marked_for_destruction?, #to_hash
Methods included from Concerns::EventHandlable
Class Method Details
.service_name ⇒ Object
Note:
Override Services::Base.service_name.
23 24 25 |
# File 'lib/qiita/team/services/hooks/hipchat_v1.rb', line 23 def self.service_name "HipChat" end |
Instance Method Details
#item_became_coediting(event) ⇒ void
This method returns an undefined value.
51 52 53 |
# File 'lib/qiita/team/services/hooks/hipchat_v1.rb', line 51 def item_became_coediting(event) "#{user_link(event.user)} changed #{item_link(event.item)} to coedit mode." end |
#item_comment_created(event) ⇒ void
This method returns an undefined value.
58 59 60 61 62 63 |
# File 'lib/qiita/team/services/hooks/hipchat_v1.rb', line 58 def item_comment_created(event) " \#{user_link(event.user)} commented on \#{item_link(event.item)}.\n <pre>\#{event.comment.body.truncate(100)}</pre>\n EOM\nend\n".strip_heredoc |
#item_created(event) ⇒ void
This method returns an undefined value.
37 38 39 |
# File 'lib/qiita/team/services/hooks/hipchat_v1.rb', line 37 def item_created(event) "#{user_link(event.user)} created #{item_link(event.item)}." end |
#item_updated(event) ⇒ void
This method returns an undefined value.
44 45 46 |
# File 'lib/qiita/team/services/hooks/hipchat_v1.rb', line 44 def item_updated(event) "#{user_link(event.user)} updated #{item_link(event.item)}." end |
#ping ⇒ void
28 29 30 31 32 |
# File 'lib/qiita/team/services/hooks/hipchat_v1.rb', line 28 def ping "Test message sent from Qiita:Team" rescue DeliveryError nil end |
#project_activated(event) ⇒ void
This method returns an undefined value.
99 100 101 |
# File 'lib/qiita/team/services/hooks/hipchat_v1.rb', line 99 def project_activated(event) ("#{user_link(event.user)} activated #{project_link(event.project)} project.") end |
#project_archived(event) ⇒ void
This method returns an undefined value.
106 107 108 |
# File 'lib/qiita/team/services/hooks/hipchat_v1.rb', line 106 def project_archived(event) ("#{user_link(event.user)} archived #{event.project.name} project.") end |
#project_comment_created(event) ⇒ void
This method returns an undefined value.
68 69 70 71 72 73 |
# File 'lib/qiita/team/services/hooks/hipchat_v1.rb', line 68 def project_comment_created(event) " \#{user_link(event.user)} commented on \#{project_link(event.project)}.\n <pre>\#{event.comment.body.truncate(100)}</pre>\n EOM\nend\n".strip_heredoc |
#project_created(event) ⇒ void
This method returns an undefined value.
85 86 87 |
# File 'lib/qiita/team/services/hooks/hipchat_v1.rb', line 85 def project_created(event) ("#{user_link(event.user)} created #{project_link(event.project)} project.") end |
#project_updated(event) ⇒ void
This method returns an undefined value.
92 93 94 |
# File 'lib/qiita/team/services/hooks/hipchat_v1.rb', line 92 def project_updated(event) ("#{user_link(event.user)} updated #{project_link(event.project)} project.") end |
#team_member_added(event) ⇒ void
This method returns an undefined value.
78 79 80 |
# File 'lib/qiita/team/services/hooks/hipchat_v1.rb', line 78 def team_member_added(event) ("#{user_link(event.member)} was added to #{event.team.name} team.") end |