Module: Vindi::Rest::Notification
- Included in:
- Vindi::Rest
- Defined in:
- lib/vindi/rest/notification.rb
Overview
Methods for the notifications API
Instance Method Summary collapse
-
#create_notification(options = {}) ⇒ Hash
Create a notification for a merchant vindi.
-
#create_notification_item(notification_id, options = {}) ⇒ Object
Creates notification items for a merchant.
-
#delete_notification(notification_id, options = {}) ⇒ Object
Delete a notification from merchant vindi.
-
#delete_notification_item(notification_id, notification_item_id, options = {}) ⇒ Object
Delete a notification item from merchant vindi.
-
#list_notification_items(notification_id, options = {}) ⇒ Object
List notification items for a merchant.
-
#list_notifications(options = {}) ⇒ Array<Hash>
List notifications for the authenticate user.
-
#notification(notification_id, options = {}) ⇒ Hash
Get a single notification from a merchant.
-
#update_notification(notification_id, options = {}) ⇒ Object
Edit a notification.
Instance Method Details
#create_notification(options = {}) ⇒ Hash
Create a notification for a merchant vindi
37 38 39 |
# File 'lib/vindi/rest/notification.rb', line 37 def create_notification( = {}) post('notifications', )[:notification] end |
#create_notification_item(notification_id, options = {}) ⇒ Object
Creates notification items for a merchant
69 70 71 72 |
# File 'lib/vindi/rest/notification.rb', line 69 def create_notification_item(notification_id, = {}) url = "notifications/%{id}/notification_items" % { id: notification_id } post(url, )[:notification_item] end |
#delete_notification(notification_id, options = {}) ⇒ Object
Delete a notification from merchant vindi
82 83 84 |
# File 'lib/vindi/rest/notification.rb', line 82 def delete_notification(notification_id, = {}) delete("notifications/#{notification_id}", )[:notification] end |
#delete_notification_item(notification_id, notification_item_id, options = {}) ⇒ Object
Delete a notification item from merchant vindi
95 96 97 98 99 100 |
# File 'lib/vindi/rest/notification.rb', line 95 def delete_notification_item(notification_id, notification_item_id, = {}) url = "notifications/%{id}/notification_items/%{notification_item_id}" % { id: notification_id, notification_item_id: notification_item_id } delete(url, )[:notification_item] end |
#list_notification_items(notification_id, options = {}) ⇒ Object
List notification items for a merchant
58 59 60 61 |
# File 'lib/vindi/rest/notification.rb', line 58 def list_notification_items(notification_id, = {}) url = "notifications/%{id}/notification_items" % { id: notification_id } get(url, )[:notification_items] end |
#list_notifications(options = {}) ⇒ Array<Hash>
List notifications for the authenticate user
11 12 13 |
# File 'lib/vindi/rest/notification.rb', line 11 def list_notifications( = {}) get('notifications', )[:notifications] end |
#notification(notification_id, options = {}) ⇒ Hash
Get a single notification from a merchant
22 23 24 |
# File 'lib/vindi/rest/notification.rb', line 22 def notification(notification_id, = {}) get("notifications/#{notification_id}", )[:notification] end |
#update_notification(notification_id, options = {}) ⇒ Object
Edit a notification
48 49 50 |
# File 'lib/vindi/rest/notification.rb', line 48 def update_notification(notification_id, = {}) put("notifications/#{notification_id}", )[:notification] end |