Class: NotificationService

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document
Defined in:
app/models/notification_service.rb

Constant Summary collapse

Fields =
[]
Label =

Retrieve tracker label from either class or instance.

''

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.labelObject


49
# File 'app/models/notification_service.rb', line 49

def self.label; self::Label; end

Instance Method Details

#check_paramsObject

Subclasses are responsible for overwriting this method.


35
# File 'app/models/notification_service.rb', line 35

def check_params; true; end

#configured?Boolean

Returns:

  • (Boolean)

52
53
54
# File 'app/models/notification_service.rb', line 52

def configured?
  api_token.present?
end

#labelObject


50
# File 'app/models/notification_service.rb', line 50

def label; self.class.label; end

#notification_description(problem) ⇒ Object


37
38
39
# File 'app/models/notification_service.rb', line 37

def notification_description(problem)
  "[#{ problem.environment }][#{ problem.where }] #{problem.message.to_s.truncate(100)}"
end

#notify_at_noticesObject


30
31
32
# File 'app/models/notification_service.rb', line 30

def notify_at_notices
  Errbit::Config.per_app_notify_at_notices ? super : Errbit::Config.notify_at_notices
end

#problem_url(problem) ⇒ Object


56
57
58
# File 'app/models/notification_service.rb', line 56

def problem_url(problem)
  "#{Errbit::Config.protocol}://#{Errbit::Config.host}/apps/#{problem.app.id}/problems/#{problem.id}"
end

#typeObject

Allows us to set the issue tracker class from a single form.


42
# File 'app/models/notification_service.rb', line 42

def type; self._type; end

#type=(t) ⇒ Object


43
# File 'app/models/notification_service.rb', line 43

def type=(t); self._type=t; end

#urlObject


45
# File 'app/models/notification_service.rb', line 45

def url; nil; end