Class: Smyte::Notification
- Inherits:
-
Object
- Object
- Smyte::Notification
- Defined in:
- lib/smyte/notification.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(response, options = {}) ⇒ Notification
constructor
A new instance of Notification.
- #items ⇒ Object
Constructor Details
#initialize(response, options = {}) ⇒ Notification
Returns a new instance of Notification.
12 13 14 15 |
# File 'lib/smyte/notification.rb', line 12 def initialize(response, = {}) @response = response = || {} end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/smyte/notification.rb', line 10 def end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
10 11 12 |
# File 'lib/smyte/notification.rb', line 10 def response @response end |
Class Method Details
.parse(webhook_secret, response, options = {}) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/smyte/notification.rb', line 3 def self.parse(webhook_secret, response, = {}) if webhook_secret != Smyte.webhook_secret raise "invalid webhook_secret: #{webhook_secret}" end Smyte::Notification.new(response, ) end |
Instance Method Details
#items ⇒ Object
17 18 19 |
# File 'lib/smyte/notification.rb', line 17 def items @items ||= parse_items end |