Class: Notificate::Notice
- Inherits:
-
Object
- Object
- Notificate::Notice
- Includes:
- HTTParty
- Defined in:
- lib/notificate/notice.rb
Instance Method Summary collapse
- #app_notice(payload) ⇒ Object
- #exception_notice(payload) ⇒ Object
-
#initialize(message, message_type) ⇒ Notice
constructor
A new instance of Notice.
Constructor Details
#initialize(message, message_type) ⇒ Notice
Returns a new instance of Notice.
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/notificate/notice.rb', line 4 def initialize(, ) @defaults = { headers: { 'Content-Type' => 'application/json'} } case when :application app_notice() when :exception exception_notice() end end |
Instance Method Details
#app_notice(payload) ⇒ Object
15 16 17 |
# File 'lib/notificate/notice.rb', line 15 def app_notice(payload) self.class.post(Notificate.request_path, payload.merge(@defaults)) end |
#exception_notice(payload) ⇒ Object
19 20 21 |
# File 'lib/notificate/notice.rb', line 19 def exception_notice(payload) self.class.post(Notificate.request_path, payload.merge(@defaults)) end |