Class: Dropcam::NotificationBase
- Defined in:
- lib/dropcam/notification_base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_enabled ⇒ Object
Returns the value of attribute is_enabled.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Base
Instance Method Summary collapse
- #delete(notifcation_id) ⇒ Object
- #devices ⇒ Object
-
#initialize(camera) ⇒ NotificationBase
constructor
A new instance of NotificationBase.
Methods inherited from Base
Constructor Details
#initialize(camera) ⇒ NotificationBase
Returns a new instance of NotificationBase.
7 8 9 |
# File 'lib/dropcam/notification_base.rb', line 7 def initialize(camera) @camera = camera end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/dropcam/notification_base.rb', line 5 def id @id end |
#is_enabled ⇒ Object
Returns the value of attribute is_enabled.
5 6 7 |
# File 'lib/dropcam/notification_base.rb', line 5 def is_enabled @is_enabled end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/dropcam/notification_base.rb', line 5 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/dropcam/notification_base.rb', line 5 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/dropcam/notification_base.rb', line 5 def value @value end |
Instance Method Details
#delete(notifcation_id) ⇒ Object
24 25 26 27 |
# File 'lib/dropcam/notification_base.rb', line 24 def delete(notifcation_id) response = post(::CAMERA_DELETE_NOTIFICATION, {"id"=>notifcation_id}, @camera.) true end |
#devices ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/dropcam/notification_base.rb', line 11 def devices response = get(::CAMERA_FIND_NOTIFICATIONS, { "id" => @camera.uuid }, @camera.) notifications = [] all_notifications = JSON.parse(response.body)["items"] all_notifications.each{|note| notifications.push Notification.new(@camera, note["target"]) } notifications end |