Class: Telapi::Notification

Inherits:
Resource
  • Object
show all
Defined in:
lib/telapi/notification.rb

Overview

Wraps TelAPI Notification functionality

Class Method Summary collapse

Methods inherited from Resource

#attributes, #initialize

Methods included from Network

api_uri, default_options, delete, post, response_format

Constructor Details

This class inherits a constructor from Telapi::Resource

Class Method Details

.get(id) ⇒ Object

Returns a Telapi::Notification object given its id See www.telapi.com/docs/api/rest/notifications/view/



22
23
24
25
# File 'lib/telapi/notification.rb', line 22

def get(id)
  response = Network.get(['Notifications', id])
  Notification.new(response)
end

.list(optional_params = {}) ⇒ Object

Returns a resource collection containing Telapi::Notification objects See www.telapi.com/docs/api/rest/notifications/list/

Also, notifications can be scoped to a call, see Telapi::Call::notifications

Optional params is a hash containing:

Log

0 (error), 1 (warning), or 2 (info)

Page

integer greater than 0

PageSize

integer greater than 0



15
16
17
18
# File 'lib/telapi/notification.rb', line 15

def list(optional_params = {})
  response = Network.get(['Notifications'], optional_params)
  ResourceCollection.new(response, 'notifications', self)
end